/** * 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.avif "isNear operator") * * @since 4.31 */ import type { LengthUnit } from "../../core/units.js"; import type { GeometryUnion } from "../types.js"; /** @since 5.2 */ export interface IsNearOptions { /** * 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; } /** * @deprecated * since 5.2. Refactor using \@arcgis/codemod or manually replace usages * with [IsNearOptions](https://developers.arcgis.com/javascript/latest/references/core/geometry/operators/isNearOperator/#IsNearOptions). */ export type Options = IsNearOptions; /** * 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`. * @since 5.2 * @example * // Check if two geometries are near each other * const isNear = isNearExecute(point, polyline, 100); */ export function isNearExecute(geometry1: GeometryUnion, geometry2: GeometryUnion, distance: number, options?: IsNearOptions): boolean; /** * Returns true if the geometries are not further than the given 2D distance from each other. * * @deprecated * since 5.2. Refactor using \@arcgis/codemod or manually replace usages * with [isNearExecute()](https://developers.arcgis.com/javascript/latest/references/core/geometry/operators/isNearOperator/#isNearExecute). * @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 = isNearExecute(point, polyline, 100); */ export function execute(geometry1: GeometryUnion, geometry2: GeometryUnion, distance: number, options?: IsNearOptions): boolean; /** * Indicates if the operator supports input geometries that contain curves. * The value will always be `true`. * * @since 5.2 */ export const isNearSupportsCurves: boolean; /** * Indicates if the operator supports input geometries that contain curves. * The value will always be `true`. * * @deprecated * since 5.2. Refactor using \@arcgis/codemod or manually replace usages * with [isNearSupportsCurves](https://developers.arcgis.com/javascript/latest/references/core/geometry/operators/isNearOperator/#isNearSupportsCurves). */ export const supportsCurves: ReturnType;