Skip to main content
Version: 6.5.0

lineIntersect

Description

Takes any LineString or Polygon GeoJSON and returns the intersecting point(s).

Parameters

NameTypeDescription
line1GeoJSONany LineString or Polygon
line2GeoJSONany LineString or Polygon

Returns

Examples

var line1 = turf.lineString([
[126, -11],
[129, -21],
]);
var line2 = turf.lineString([
[123, -18],
[131, -14],
]);
var intersects = turf.lineIntersect(line1, line2);

Installation

$ npm install @turf/line-intersect

import { lineIntersect } from "@turf/line-intersect";
const result = lineIntersect(...);
$ npm install @turf/turf

import * as turf from "@turf/turf";
const result = turf.lineIntersect(...);