simplifyOperator

AMD: require(["esri/geometry/operators/simplifyOperator"], (simplifyOperator) => { /* code goes here */ });
ESM: import * as simplifyOperator from "@arcgis/core/geometry/operators/simplifyOperator.js";
Object: esri/geometry/operators/simplifyOperator
Since: ArcGIS Maps SDK for JavaScript 4.31
beta

Simplifies 2D geometries by removing unnecessary vertices while preserving the geometry shape. This makes them topologically legal with respect to their geometry type. At the end of a simplify operation, no polygon rings or polyline paths will overlap, and no self-intersection will occur.

Method Overview

Name Return Type Summary Object

Performs the simplify operation on a single geometry.

simplifyOperator

Performs the simplify operation on the geometry set.

simplifyOperator

Indicates if the given geometry is topologically simple.

simplifyOperator

Method Details

execute

Method
execute(geometry){Geometry |null}

Performs the simplify operation on a single geometry.

Parameter
geometry Geometry

The geometry to be simplified.

Returns
Type Description
Geometry | null Returns the simplified geometry or null.
Example
// Topologically simplifies a geometry
const simplified = simplifyOperator.execute(polyline);
console.log(simplifyOperator.isSimple(simplified)); // true

executeMany

Method
executeMany(geometries){Array<(Geometry|null)>}

Performs the simplify operation on the geometry set.

Parameter
geometries Geometry[]

The array of geometries to be simplified,

Returns
Type Description
Array<(Geometry|null)> Returns an array whose elements may either be simplified geometries or null.

isSimple

Method
isSimple(geometry){Boolean}

Indicates if the given geometry is topologically simple. In a simplified geometry, no polygon rings or polyline paths will overlap, and no self-intersection will occur.

Parameter
geometry Geometry

The input geometry.

Returns
Type Description
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

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.