Skip to main content
Version: 7.1.0

lineSplit

Description

Split a LineString by another GeoJSON Feature.

Parameters

NameTypeDescription
lineFeature<LineString>LineString Feature to split
splitterFeature<any>Feature used to split line

Returns

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(...);