Skip to main content
Version: 7.3.0

booleanTouches

描述

🌐 Description

如果两个几何体共有的任何点都不与两个几何体的内部相交,则布尔值为 true。

🌐 Boolean-touches true if none of the points common to both geometries intersect the interiors of both geometries.

参数

🌐 Parameters

名称类型描述
feature1Geometry | Feature<any>GeoJSON 特性或几何
feature2Geometry | Feature<any>GeoJSON 特性或几何

返回

🌐 Returns

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(...);