import * as simplifyOGCOperator from "@arcgis/core/geometry/operators/simplifyOGCOperator.js";
const simplifyOGCOperator = await $arcgis.import("@arcgis/core/geometry/operators/simplifyOGCOperator.js");
@arcgis/core/geometry/operators/simplifyOGCOperator
Simplifies geometries to enforce topological correctness according to the OGC Simple Feature Access specification 1.2.1. This operator uses stricter rules than simplifyOperator.
Property Overview
Name | Type | Summary | Object |
---|---|---|---|
Indicates if the operator supports input geometries that contain curves. | simplifyOGCOperator |
Property Details
-
supportsCurves
supportsCurves Booleanreadonly
-
Indicates if the operator supports input geometries that contain curves.
- Default Value:true
Method Overview
Name | Return Type | Summary | Object |
---|---|---|---|
Performs the OGC simplify operation on a single geometry. | simplifyOGCOperator | ||
Performs the OGC simplify operation on the geometry set. | simplifyOGCOperator | ||
Indicates if the given geometry is OGC topologically simple. | simplifyOGCOperator |
Method Details
-
execute
execute(geometry){GeometryUnion |null |undefined}
-
Performs the OGC simplify operation on a single geometry.
Parametergeometry GeometryUnionThe geometry to be simplified.
ReturnsType Description GeometryUnion | null | undefined Returns the simplified geometry, or null. Geometry's with non-finite x or y, or infinite Zs return null. The method will set NaN z values to 0. Example// Topologically simplifies a geometry const simplified = simplifyOGCOperator.execute(polyline); console.log(simplifyOGCOperator.isSimple(simplified)); // true
-
executeMany
executeMany(geometries){Array<(GeometryUnion|null|undefined)>}
-
Performs the OGC simplify operation on the geometry set.
Parametergeometries GeometryUnion[]The array of geometries to be simplified, All the geometries must have the same spatial reference.
ReturnsType Description Array<(GeometryUnion|null|undefined)> Returns the simplified geometry, or null. Geometry's with non-finite x or y, or infinite Zs return null. The method will set NaN z values to 0.
-
isSimple
isSimple(geometry){Boolean}
-
Indicates if the given geometry is 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 taken into account.
For a given Polyline path, there can be no intersections between segments with exception of the first and the last points of a path, which can coincide forming a closed path with no boundary points. Different paths can only intersect at the boundary points.
Polygon geometries are considered simple if the following is true:
- Rings cannot have self intersections, or self-tangency.
- Rings are sorted such that each exterior ring is followed by its immediate interior ring (holes). The exterior ring with the corresponding holes form the OGC polygon type.
- The interior has to be a connected set. Any two points in the interior can be connected by a path that contains only interior points.
- Exterior rings have to be oriented clockwise, holes are oriented counterclockwise.
All tests for equality or segment intersections use the tolerance and resolution. The operator uses 2 * sqrt(2) * tolerance when checking whether two points are equal, and sqrt(2) * tolerance when checking if a point lies on a segment. Both values are 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. Resolution is added to take into account possible rounding errors.
Parametergeometry GeometryUnionThe input geometry.
ReturnsType Description Boolean Returns true if the geometry is simple, otherwise returns false. Example// returns true if given geometry is OGC simple const simple = simplifyOGCOperator.isSimple(polyline); console.log(simple); // true | false