/** * Applies Esri (non-OGC) simplification to 2D geometries by removing unnecessary vertices while preserving the geometry's shape. * Simplified geometries are topologically legal for their geometry type. * * **NOTE:** Esri simplicity does NOT guarantee OGC simplicity. Use the [simplifyOGCOperator](https://developers.arcgis.com/javascript/latest/references/core/geometry/operators/simplifyOGCOperator/) when OGC-compliant geometries are required. * * ![Simplify operator](https://developers.arcgis.com/javascript/latest/assets/references/core/operators/isSimple.avif "Simplify operator") * * @since 4.31 */ import type { GeometryUnion, GeometryWithoutMeshUnion } from "../types.js"; /** * Performs the simplify operation on a single geometry. * * @param geometry - The geometry to be simplified. * @returns Returns the simplified geometry or null. * @since 5.2 * @example * // Topologically simplifies a geometry * const simplified = simplifyExecute(polyline); * console.log(simplifyIsSimple(simplified)); // true */ export function simplifyExecute(geometry: GeometryUnion): GeometryWithoutMeshUnion | null | undefined; /** * Performs the simplify operation on a single geometry. * * @deprecated * since 5.2. Refactor using \@arcgis/codemod or manually replace usages * with [simplifyExecute()](https://developers.arcgis.com/javascript/latest/references/core/geometry/operators/simplifyOperator/#simplifyExecute). * @param geometry - The geometry to be simplified. * @returns Returns the simplified geometry or null. * @example * // Topologically simplifies a geometry * const simplified = simplifyExecute(polyline); * console.log(simplifyIsSimple(simplified)); // true */ export function execute(geometry: GeometryUnion): GeometryWithoutMeshUnion | null | undefined; /** * Performs the simplify operation on the geometry set. * * @param geometries - The array of geometries to be simplified. * All the geometries must have the same spatial reference. * @returns Returns an array whose elements may either be simplified geometries or null. * @since 5.2 */ export function simplifyExecuteMany(geometries: GeometryUnion[]): (GeometryWithoutMeshUnion | null | undefined)[]; /** * Performs the simplify operation on the geometry set. * * @deprecated * since 5.2. Refactor using \@arcgis/codemod or manually replace usages * with [simplifyExecuteMany()](https://developers.arcgis.com/javascript/latest/references/core/geometry/operators/simplifyOperator/#simplifyExecuteMany). * @param geometries - The array of geometries to be simplified. * All the geometries must have the same spatial reference. * @returns Returns an array whose elements may either be simplified geometries or null. */ export function executeMany(geometries: GeometryUnion[]): (GeometryWithoutMeshUnion | null | undefined)[]; /** * Checks whether the given geometry is Esri topologically simple. This operation takes into account z-values. * * [Point](https://developers.arcgis.com/javascript/latest/references/core/geometry/Point/) geometries are always simple. * * [Multipoint](https://developers.arcgis.com/javascript/latest/references/core/geometry/Multipoint/) geometries cannot contain points with identical x- and y-coordinates. * The tolerance is not taken into account. * * [Polyline](https://developers.arcgis.com/javascript/latest/references/core/geometry/Polyline/) geometries can have self-intersecting paths but cannot contain degenerate segments. * A degenerate segment is a zero-length segment whose start and end points are essentially the same. * When the polyline has no z-values, degenerate segments have a length in the xy-plane less than or equal to the tolerance. * When the polyline has z-values, degenerate segments are shorter than the tolerance in the xy-plane and have a z-difference less than or equal to the z-tolerance. * * [Polygon](https://developers.arcgis.com/javascript/latest/references/core/geometry/Polygon/) geometries are simple when: * * Rings do not self-intersect. * * Exterior rings are clockwise and interior rings (holes) are counterclockwise. * * Rings can touch other rings at a finite number of points. * * Rings can be self-tangent at a finite number of points. * * Vertices are either exactly coincident or farther than 2 * sqrt(2) * tolerance from each other. * * Vertices that are not equal to a segment boundary point must be farther than sqrt(2) * tolerance from any segment. * * Segments have non-zero length. * * Each ring contains at least three distinct vertices. * * Empty rings are not allowed. * * Ring order does not matter. * * The tolerance is obtained from the geometry's spatial reference. If the spatial reference is null, a small tolerance is derived from the geometry coordinates using double precision. * * @param geometry - The input geometry. * @returns Returns whether the geometry is simple. * @since 5.2 * @example * // returns true if given geometry is simple * const simple = simplifyIsSimple(polyline); * console.log(simple); // true | false */ export function simplifyIsSimple(geometry: GeometryUnion): boolean; /** * Checks whether the given geometry is Esri topologically simple. This operation takes into account z-values. * * [Point](https://developers.arcgis.com/javascript/latest/references/core/geometry/Point/) geometries are always simple. * * [Multipoint](https://developers.arcgis.com/javascript/latest/references/core/geometry/Multipoint/) geometries cannot contain points with identical x- and y-coordinates. * The tolerance is not taken into account. * * [Polyline](https://developers.arcgis.com/javascript/latest/references/core/geometry/Polyline/) geometries can have self-intersecting paths but cannot contain degenerate segments. * A degenerate segment is a zero-length segment whose start and end points are essentially the same. * When the polyline has no z-values, degenerate segments have a length in the xy-plane less than or equal to the tolerance. * When the polyline has z-values, degenerate segments are shorter than the tolerance in the xy-plane and have a z-difference less than or equal to the z-tolerance. * * [Polygon](https://developers.arcgis.com/javascript/latest/references/core/geometry/Polygon/) geometries are simple when: * * Rings do not self-intersect. * * Exterior rings are clockwise and interior rings (holes) are counterclockwise. * * Rings can touch other rings at a finite number of points. * * Rings can be self-tangent at a finite number of points. * * Vertices are either exactly coincident or farther than 2 * sqrt(2) * tolerance from each other. * * Vertices that are not equal to a segment boundary point must be farther than sqrt(2) * tolerance from any segment. * * Segments have non-zero length. * * Each ring contains at least three distinct vertices. * * Empty rings are not allowed. * * Ring order does not matter. * * The tolerance is obtained from the geometry's spatial reference. If the spatial reference is null, a small tolerance is derived from the geometry coordinates using double precision. * * @deprecated * since 5.2. Refactor using \@arcgis/codemod or manually replace usages * with [simplifyIsSimple()](https://developers.arcgis.com/javascript/latest/references/core/geometry/operators/simplifyOperator/#simplifyIsSimple). * @param geometry - The input geometry. * @returns Returns whether the geometry is simple. * @example * // returns true if given geometry is simple * const simple = simplifyIsSimple(polyline); * console.log(simple); // true | false */ export function isSimple(geometry: GeometryUnion): boolean; /** * Indicates if the operator supports input geometries that contain curves. * The value will always be `true`. * * @since 5.2 */ export const simplifySupportsCurves: 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 [simplifySupportsCurves](https://developers.arcgis.com/javascript/latest/references/core/geometry/operators/simplifyOperator/#simplifySupportsCurves). */ export const supportsCurves: ReturnType;