require(["esri/geometry/operators/simplifyOperator"], (simplifyOperator) => { /* code goes here */ });
import * as simplifyOperator from "@arcgis/core/geometry/operators/simplifyOperator.js";
esri/geometry/operators/simplifyOperator
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
-
Performs the simplify operation on a single geometry.
Parametergeometry GeometryThe geometry to be simplified.
ReturnsExample// Topologically simplifies a geometry const simplified = simplifyOperator.execute(polyline); console.log(simplifyOperator.isSimple(simplified)); // true
-
Performs the simplify operation on the geometry set.
Returns
-
isSimple
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.
Parametergeometry GeometryThe input geometry.
ReturnsType 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