Split a LineString by another GeoJSON Feature.
npm install @turf/line-splitSplit a LineString by another GeoJSON Feature.
* line [Feature][1]<[LineString][2]> LineString Feature to split
* splitter [Feature][1]\
``javascript
var line = turf.lineString([[120, -25], [145, -25]]);
var splitter = turf.lineString([[130, -15], [130, -35]]);
var split = turf.lineSplit(line, splitter);
//addToMap
var addToMap = [line, splitter, split]
split.features[0].properties.stroke = "red";
split.features[1].properties.stroke = "blue";
`
Returns [FeatureCollection][3]<[LineString][2]> Split LineStrings
[1]: https://tools.ietf.org/html/rfc7946#section-3.2
[2]: https://tools.ietf.org/html/rfc7946#section-3.1.4
[3]: https://tools.ietf.org/html/rfc7946#section-3.3
---
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 single module individually:
`sh`
$ npm install @turf/line-split
Or install the all-encompassing @turf/turf module that includes all modules as functions:
`sh``
$ npm install @turf/turf