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

Applies Esri (non-OGC) simplification to 2D geometries by removing unnecessary vertices while preserving the geometry shape. This makes them topologically legal with respect to their geometry type. This operator is less strict than simplifyOGCOperator.

Simplify operator

Functions

execute

Function

Performs the simplify operation on a single geometry.

Signature
execute (geometry: GeometryUnion): GeometryWithoutMeshUnion | null | undefined
Parameters
ParameterTypeDescriptionRequired
geometry

The geometry to be simplified.

Returns
GeometryWithoutMeshUnion | null | undefined

Returns the simplified geometry or null.

Example
// Topologically simplifies a geometry
const simplified = simplifyOperator.execute(polyline);
console.log(simplifyOperator.isSimple(simplified)); // true

executeMany

Function

Performs the simplify operation on the geometry set.

Signature
executeMany (geometries: GeometryUnion[]): (GeometryWithoutMeshUnion | null | undefined)[]
Parameters
ParameterTypeDescriptionRequired
geometries

The array of geometries to be simplified, All the geometries must have the same spatial reference.

Returns
(GeometryWithoutMeshUnion | null | undefined)[]

Returns an array whose elements may either be simplified geometries or null.

isSimple

Function

Indicates if the given geometry is non-OGC topologically simple. This operation takes into account z-values.

Point geometries are always simple.

Multipoint geometries cannot have any points with exactly equal x and y. The tolerance is not taken into account.

Polyline geometries can have self-intersecting paths, however they cannot have degenerate segments. A degenerate segment is a zero-length segment where the start and end points are essentially the same. When the polyline has no z, degenerate segments are those that have a length in the xy plane less than or equal to the tolerance. When the polyline has z, degenerate segments are those that are shorter than the tolerance in the xy plane, and the change in the z-value along the segment is less than or equal to the z-tolerance.

Polygon geometries are considered simple if the following is true:

  • Contains no self-intersecting rings.
  • Exterior rings are clockwise, and interior rings (holes) are counterclockwise.
  • Rings can touch other rings in a finite number of points.
  • Rings can be self-tangent in a finite number of points.
  • Vertices are either exactly coincident, or further than the 2 * sqrt(2) * tolerance from each other.
  • If a vertex is not equal to any boundary point of a segment, it has to be further than sqrt(2) * tolerance from any segment.
  • No segment length is zero.
  • Each path contains at least three non-equal vertices.
  • No empty paths are allowed.
  • Order of rings does not matter.

The tolerance value is obtained from the geometry's spatial reference. If it is null, then a small tolerance value is calculated from the geometry coordinates using double-precision.

Signature
isSimple (geometry: GeometryUnion): boolean
Parameters
ParameterTypeDescriptionRequired
geometry

The input geometry.

Returns
boolean

Returns true if the geometry is simple, otherwise returns false.

Example
// returns true if given geometry is simple
const simple = simplifyOperator.isSimple(polyline);
console.log(simple); // true | false

Variables

supportsCurves

Variable

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

Type
boolean