UNPKG

@arcgis/core

Version:

ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API

39 lines (36 loc) 1.52 kB
/** * Performs a 2D relational operation that checks if two geometries are near each other. * * ![isNear operator](https://developers.arcgis.com/javascript/latest/assets/references/core/operators/isNear.png "isNear operator") * * @since 4.31 */ import type { LengthUnit } from "../../core/units.js"; import type { GeometryUnion } from "../types.js"; export interface Options { /** * 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. */ unit?: LengthUnit; } /** * Returns true if the geometries are not further than the given 2D distance from each other. * * @param geometry1 - The first geometry. * @param geometry2 - The second geometry. * @param distance - The distance (must be positive). * Unless the `unit` option is set, the default is the geometry's spatial reference unit. * @param options - Additional options. * @returns 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); */ export function execute(geometry1: GeometryUnion, geometry2: GeometryUnion, distance: number, options?: Options): boolean; /** * Indicates if the operator supports input geometries that contain curves. * The value will always be `true`. */ export const supportsCurves: boolean;