Skip to content

KBE3D / KBCore / turf / booleanClockwise

函数: booleanClockwise()

booleanClockwise(line: LineString | Feature<LineString, GeoJsonProperties> | Position[]): boolean

Function

Takes a ring and return true or false whether or not the ring is clockwise or counter-clockwise.

参数

line

to be evaluated

LineString | Feature<LineString, GeoJsonProperties> | Position[]

返回

boolean

true/false

示例

ts
var clockwiseRing = turf.lineString([[0,0],[1,1],[1,0],[0,0]]);
var counterClockwiseRing = turf.lineString([[0,0],[1,0],[1,1],[0,0]]);

turf.booleanClockwise(clockwiseRing)
//=true
turf.booleanClockwise(counterClockwiseRing)
//=false

KBE3D @3.0.0 Copyright © 2024-present KBE3D