isNearOperator

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

Performs a 2D relational operation that checks if two geometries are near each other.

Property Overview

Name Type Summary Object

Indicates if the operator supports input geometries that contain curves.

isNearOperator

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

Returns true if the geometries are not further than the given 2D distance from each other.

isNearOperator

Method Details

execute

Method
execute(geometry1, geometry2, distance, options){Boolean}

Returns true if the geometries are not further than the given 2D distance from each other.

Parameters
geometry1 GeometryUnion

The first geometry.

geometry2 GeometryUnion

The second geometry.

distance Number

The distance (must be positive). Unless the unit option is set, the default is the geometry's spatial reference unit.

options Object
optional

Additional options.

Specification
unit LengthUnit
optional

The length unit of the distance. An error will be thrown if this is set for Geographic Coordinate Systems.

Returns
Type Description
Boolean Returns true if the minimum distance between the two geometries is equal or less than distance.
Example
// Check if two geometries are near each other
const isNear = isNearOperator.execute(point, polyline, 100);

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