require(["esri/geometry/operators/isNearOperator"], (isNearOperator) => { /* code goes here */ });
import * as isNearOperator from "@arcgis/core/geometry/operators/isNearOperator.js";
esri/geometry/operators/isNearOperator
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
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
execute(geometry1, geometry2, distance, options){Boolean}
-
Returns true if the geometries are not further than the given 2D distance from each other.
Parametersgeometry1 GeometryUnionThe first geometry.
geometry2 GeometryUnionThe second geometry.
distance NumberThe distance (must be positive). Unless the
unit
option is set, the default is the geometry's spatial reference unit.options ObjectoptionalAdditional options.
Specificationunit LengthUnitoptionalThe length unit of the distance. An error will be thrown if this is set for Geographic Coordinate Systems.
ReturnsType Description Boolean Returns true
if the minimum distance between the two geometries is equal or less thandistance
.Example// Check if two geometries are near each other const isNear = isNearOperator.execute(point, polyline, 100);