lineIntersect
Description
Takes any LineString or Polygon GeoJSON and returns the intersecting point(s).
Parameters
| Name | Type | Description | 
|---|---|---|
| line1 | GeoJSON | any LineString or Polygon | 
| line2 | GeoJSON | any LineString or Polygon | 
Returns
FeatureCollection<Point> point(s) that intersect both
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(...);