Atlaslog
Atlaslog / Turf.js / API / lineIntersect
Turf.js · API reference

lineIntersect

Quick answer

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

Last verified 2026-11-03 · Turf.js 7.x · Cite this page
Runnable examplesChinese noteAll API topics

Description​

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

Parameters​

NameTypeDescription
line1GeoJSONany LineString or Polygon
line2GeoJSONany LineString or Polygon
options?ObjectOptional parameters (default {})
options.removeDuplicates?booleanremove duplicate intersections (default true)
options.ignoreSelfIntersections?booleanignores self-intersections on input features (default true)

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(...);
TutorialsAPI index
English reference text adapted from the official Turf.js documentation, © Turf.js contributors, licensed under MIT.
Original page: https://turfjs.org/docs/api/lineIntersect · Chinese note: /turf/api/line-intersect.html
Cite this page

Atlaslog (2026). lineIntersect. https://www.jingweizhi.com/en/turf/api/line-intersect.html (accessed 2026-11-03).