turf kinks module
npm install @spatial/kinksTakes a [linestring][1], [multi-linestring][2], [multi-polygon][3], or [polygon][4] and returns [points][5] at all self-intersections.
- featureIn [Feature][6]<([LineString][7] \| [MultiLineString][8] \| [MultiPolygon][9] \| [Polygon][10])> input feature
``javascript
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);
//addToMap
var addToMap = [poly, kinks]
`
Returns [FeatureCollection][11]<[Point][12]> self-intersections
[1]: https://tools.ietf.org/html/rfc7946#section-3.1.4
[2]: https://tools.ietf.org/html/rfc7946#section-3.1.5
[3]: https://tools.ietf.org/html/rfc7946#section-3.1.7
[4]: https://tools.ietf.org/html/rfc7946#section-3.1.6
[5]: https://tools.ietf.org/html/rfc7946#section-3.1.2
[6]: https://tools.ietf.org/html/rfc7946#section-3.2
[7]: https://tools.ietf.org/html/rfc7946#section-3.1.4
[8]: https://tools.ietf.org/html/rfc7946#section-3.1.5
[9]: https://tools.ietf.org/html/rfc7946#section-3.1.7
[10]: https://tools.ietf.org/html/rfc7946#section-3.1.6
[11]: https://tools.ietf.org/html/rfc7946#section-3.3
[12]: https://tools.ietf.org/html/rfc7946#section-3.1.2
---
This module is part of the Turfjs project, an open source
module collection dedicated to geographic algorithms. It is maintained in the
Turfjs/turf repository, where you can create
PRs and issues.
Install this module individually:
`sh`
$ npm install @spatial/kinks
Or install the Turf module that includes it as a function:
`sh``
$ npm install @turf/turf