Skip to content

描述 ​

如果两个几何图形的交集为空集,则 Boolean-disjoint 返回 TRUE。

参数 ​

名称类型描述
feature1Geometry | Feature<any>GeoJSON Feature 或 Geometry
feature2Geometry | Feature<any>GeoJSON Feature 或 Geometry
options?Object可选参数 (默认 {})
options.ignoreSelfIntersections?boolean忽略输入要素的自相交 (默认 true)

返回值 ​

boolean 如果交集为空集返回 true,否则返回 false

示例 ​

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

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

安装 ​

javascript
$ npm install @turf/boolean-disjoint

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

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