lineSplit
Description
Split a LineString by another GeoJSON Feature.
Parameters
Name | Type | Description |
---|---|---|
line | Feature<LineString> | LineString Feature to split |
splitter | Feature<any> | Feature used to split line |
Returns
FeatureCollection<LineString> Split LineStrings
Examples
var line = turf.lineString([
[120, -25],
[145, -25],
]);
var splitter = turf.lineString([
[130, -15],
[130, -35],
]);
var split = turf.lineSplit(line, splitter);
Installation
$ npm install @turf/line-split
import { lineSplit } from "@turf/line-split";
const result = lineSplit(...);
$ npm install @turf/turf
import * as turf from "@turf/turf";
const result = turf.lineSplit(...);