booleanTouches
描述
¥Description
如果两个几何体的公共点均不与两个几何体的内部相交,则 Boolean-touches 返回 true。
¥Boolean-touches true if none of the points common to both geometries intersect the interiors of both geometries.
参数
¥Parameters
名称 | 类型 | 描述 |
---|---|---|
feature1 | 几何图形 | 特性<any> | GeoJSON 要素或几何体 |
feature2 | 几何图形 | 特性<any> | GeoJSON 要素或几何体 |
返回
¥Returns
boolean 真/假
¥boolean true/false
示例
¥Examples
var line = turf.lineString([
[1, 1],
[1, 2],
[1, 3],
[1, 4],
]);
var point = turf.point([1, 1]);
turf.booleanTouches(point, line);
//=true
安装
¥Installation
$ npm install @turf/boolean-touches
import { booleanTouches } from "@turf/boolean-touches";
const result = booleanTouches(...);
$ npm install @turf/turf
import * as turf from "@turf/turf";
const result = turf.booleanTouches(...);