Skip to main content
Version: 7.1.0

booleanClockwise

Description

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

Parameters

NameTypeDescription
lineFeature<LineString> | LineString | Array<Array<number>>to be evaluated

Returns

    boolean true/false

Examples

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

Installation

$ npm install @turf/boolean-clockwise

import { booleanClockwise } from "@turf/boolean-clockwise";
const result = booleanClockwise(...);
$ npm install @turf/turf

import * as turf from "@turf/turf";
const result = turf.booleanClockwise(...);