Skip to main content
Version: 7.0.0

booleanEqual

Description

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

NameTypeDescription
feature1Geometry | FeatureGeoJSON input
feature2Geometry | FeatureGeoJSON input
options?ObjectOptional parameters (default {})
options.precision?numberdecimal precision to use when comparing coordinates (default 6)

Returns

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