booleanEqual
描述
¥Description
判断两个相同类型的几何体是否具有相同的 X、Y 坐标值。参见 http://edndoc.esri.com/arcsde/9.0/general_topics/understand_spatial_relations.htm
¥Determine whether two geometries of the same type have identical X,Y coordinate values. See http://edndoc.esri.com/arcsde/9.0/general_topics/understand_spatial_relations.htm
参数
¥Parameters
名称 | 类型 | 描述 |
---|---|---|
feature1 | 几何图形 | 特性 | GeoJSON 输入 |
feature2 | 几何图形 | 特性 | GeoJSON 输入 |
options? | 对象 | 可选参数(默认 {}) |
options.precision? | number | 比较坐标时使用的小数精度(默认 6) |
返回
¥Returns
boolean 如果对象相等,则为 true,否则为 false
¥boolean true if the objects are equal, false otherwise
示例
¥Examples
var pt1 = turf.point([0, 0]);
var pt2 = turf.point([0, 0]);
var pt3 = turf.point([1, 1]);
turf.booleanEqual(pt1, pt2);
//= true
turf.booleanEqual(pt2, pt3);
//= false
安装
¥Installation
$ npm install @turf/boolean-equal
import { booleanEqual } from "@turf/boolean-equal";
const result = booleanEqual(...);
$ npm install @turf/turf
import * as turf from "@turf/turf";
const result = turf.booleanEqual(...);