import { simplifyExecute, execute, simplifyExecuteMany, executeMany, simplifyIsSimple } 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's shape. Simplified geometries are topologically legal for their geometry type.

NOTE: Esri simplicity does NOT guarantee OGC simplicity. Use the simplifyOGCOperator when OGC-compliant geometries are required.

Simplify operator

Functions

simplifyExecute

Function
Since
ArcGIS Maps SDK for JavaScript 5.2

Performs the simplify operation on a single geometry.

Signature
simplifyExecute (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 = simplifyExecute(polyline);
console.log(simplifyIsSimple(simplified)); // true

execute

deprecated 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 = simplifyExecute(polyline);
console.log(simplifyIsSimple(simplified)); // true

simplifyExecuteMany

Function
Since
ArcGIS Maps SDK for JavaScript 5.2

Performs the simplify operation on the geometry set.

Signature
simplifyExecuteMany (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.

executeMany

deprecated 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.

simplifyIsSimple

Function
Since
ArcGIS Maps SDK for JavaScript 5.2

Checks whether the given geometry is Esri topologically simple. This operation takes into account z-values.

Point geometries are always simple.

Multipoint geometries cannot contain points with identical x- and y-coordinates. The tolerance is not taken into account.

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 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.

Signature
simplifyIsSimple (geometry: GeometryUnion): boolean

Parameters

ParameterTypeDescriptionRequired
geometry

The input geometry.

Returns
boolean

Returns whether the geometry is simple.

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

isSimple

deprecated Function

Checks whether the given geometry is Esri topologically simple. This operation takes into account z-values.

Point geometries are always simple.

Multipoint geometries cannot contain points with identical x- and y-coordinates. The tolerance is not taken into account.

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 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.

Signature
isSimple (geometry: GeometryUnion): boolean

Parameters

ParameterTypeDescriptionRequired
geometry

The input geometry.

Returns
boolean

Returns whether the geometry is simple.

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

Variables

simplifySupportsCurves

Variable
Since
ArcGIS Maps SDK for JavaScript 5.2

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

Type
boolean

supportsCurves

deprecated Variable

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

Type
ReturnType