overlapsOperator

AMD: require(["esri/geometry/operators/overlapsOperator"], (overlapsOperator) => { /* code goes here */ });
ESM: import * as overlapsOperator from "@arcgis/core/geometry/operators/overlapsOperator.js";
Object: esri/geometry/operators/overlapsOperator
Since: ArcGIS Maps SDK for JavaScript 4.31

Performs a relational operation to determine if two 2D geometries of the same dimension overlap.

Property Overview

Name Type Summary Object

Indicates if the operator supports input geometries that contain curves.

overlapsOperator

Property Details

supportsCurves

Property
supportsCurves Booleanreadonly

Indicates if the operator supports input geometries that contain curves.

Default Value:true

Method Overview

Name Return Type Summary Object

Accelerate a geometry.

overlapsOperator

Perform the overlaps operation on two geometries.

overlapsOperator

Method Details

accelerateGeometry

Method
accelerateGeometry(geometry){Boolean}

Accelerate a geometry. This method prepares the geometry for faster overlaps operations when the same geometry is tested multiple times (e.g. in a loop with hundreds of iterations).

Parameter
geometry GeometryUnion

The geometry to accelerate.

Returns
Type Description
Boolean Returns true if the geometry was successfully accelerated.

execute

Method
execute(geometry1, geometry2){Boolean}

Perform the overlaps operation on two geometries.

Parameters
geometry1 GeometryUnion

The base geometry that is tested for the "overlaps" relationship with geometry2.

geometry2 GeometryUnion

The comparison geometry that is tested for the "overlaps" relationship with geometry1.

Returns
Type Description
Boolean Returns true if the intersection set results in a geometry different from both of the input geometries, but of the same dimension. For example, if geometry1 and geometry2 are both polygons, then they must return a polygon in order to overlap. If two polygons cross each other at exactly one point then no overlap has occurred because points have a dimension of 0 and polygons have a dimension of 2. See the Working with spatial relationship operators guide topic on dimensionality for more details.
Example
// Returns true if one geometry overlaps another,
// but is not contained or disjointed
const isOverlapping = overlapsOperator.execute(polygon1, polygon2);

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.