kinks
Description
Takes a linestring, multi-linestring, multi-polygon or polygon and returns points at all self-intersections.
Parameters
Name | Type | Description |
---|---|---|
featureIn | Feature<LineString | MultiLineString | MultiPolygon | Polygon> | input feature |
Returns
FeatureCollection<Point> self-intersections
Examples
var poly = turf.polygon([
[
[-12.034835, 8.901183],
[-12.060413, 8.899826],
[-12.03638, 8.873199],
[-12.059383, 8.871418],
[-12.034835, 8.901183],
],
]);
var kinks = turf.kinks(poly);
Installation
$ npm install @turf/kinks
import { kinks } from "@turf/kinks";
const result = kinks(...);
$ npm install @turf/turf
import * as turf from "@turf/turf";
const result = turf.kinks(...);