Skip to content

KBE3D / KBCore / turf / booleanWithin

函数: booleanWithin()

booleanWithin(feature1: Geometry | Feature<any, GeoJsonProperties>, feature2: Geometry | Feature<any, GeoJsonProperties>): boolean

Function

Tests whether geometry a is contained by geometry b. The interiors of both geometries must intersect, and the interior and boundary of geometry a must not intersect the exterior of geometry b. booleanWithin(a, b) is equivalent to booleanContains(b, a)

参数

feature1

GeoJSON Feature or Geometry

Geometry | Feature<any, GeoJsonProperties>

feature2

GeoJSON Feature or Geometry

Geometry | Feature<any, GeoJsonProperties>

返回

boolean

true/false

示例

ts
var line = turf.lineString([[1, 1], [1, 2], [1, 3], [1, 4]]);
var point = turf.point([1, 2]);

turf.booleanWithin(point, line);
//=true

KBE3D @3.0.0 Copyright © 2024-present KBE3D