Skip to content

描述 ​

如果两个几何图形共有的点都不与两个几何图形的内部相交,则 Boolean-touches 返回 true。

参数 ​

名称类型描述
feature1Geometry | Feature<any>GeoJSON Feature 或 Geometry
feature2Geometry | Feature<any>GeoJSON Feature 或 Geometry

返回值 ​

boolean true/false

示例 ​

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

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

安装 ​

javascript
$ npm install @turf/boolean-touches

import { booleanTouches } from "@turf/boolean-touches";
const result = booleanTouches(...);
javascript
$ npm install @turf/turf

import * as turf from "@turf/turf";
const result = turf.booleanTouches(...);