Skip to content
import { execute, supportsCurves } from "@arcgis/core/geometry/operators/isNearOperator.js";
Since
ArcGIS Maps SDK for JavaScript 4.31

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

isNear operator

Type definitions

Options

Type definition

unit

Property
Type
LengthUnit | undefined

The length unit of the distance. Unless the unit option is set, the default is the geometry's spatial reference unit. An error will be thrown if this is set for Geographic Coordinate Systems.

Functions

NameReturn TypeObject

execute

Function

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

Signature
execute (geometry1: GeometryUnion, geometry2: GeometryUnion, distance: number, options?: Options): boolean
Parameters
ParameterTypeDescriptionRequired
geometry1

The first geometry.

geometry2

The second geometry.

distance

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

options

Additional options.

Returns
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);

Variables

supportsCurves

Variable

Indicates if the operator supports input geometries that contain curves. The value will always be true.

Type
boolean