Skip to content

KBE3D / KBCore / turf / lineIntersect

函数: lineIntersect()

lineIntersect<G1, G2>(line1: G1 | FeatureCollection<G1, GeoJsonProperties> | Feature<G1, GeoJsonProperties>, line2: G2 | FeatureCollection<G2, GeoJsonProperties> | Feature<G2, GeoJsonProperties>, options?: { removeDuplicates?: boolean; ignoreSelfIntersections?: boolean; }): FeatureCollection<Point>

Function

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

类型参数

G1

G1 extends LineString | MultiLineString | Polygon | MultiPolygon

G2

G2 extends LineString | MultiLineString | Polygon | MultiPolygon

参数

line1

any LineString or Polygon

G1 | FeatureCollection<G1, GeoJsonProperties> | Feature<G1, GeoJsonProperties>

line2

any LineString or Polygon

G2 | FeatureCollection<G2, GeoJsonProperties> | Feature<G2, GeoJsonProperties>

options?

Optional parameters

removeDuplicates?

boolean

remove duplicate intersections

ignoreSelfIntersections?

boolean

ignores self-intersections on input features

返回

FeatureCollection<Point>

point(s) that intersect both

示例

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

//addToMap
var addToMap = [line1, line2, intersects]

KBE3D @3.0.0 Copyright © 2024-present KBE3D