Skip to content

KBE3D / KBCore / turf / booleanContains

函数: booleanContains()

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

Function

Tests whether geometry a contains geometry b. The interiors of both geometries must intersect, and the interior and boundary of geometry b must not intersect the exterior of geometry a. booleanContains(a, b) is equivalent to booleanWithin(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.booleanContains(line, point);
//=true

KBE3D @3.0.0 Copyright © 2024-present KBE3D