Class Simplification
- Namespace
- SpatialNET
- Assembly
- SpatialNET.Extensions.dll
Simplification by Douglas-Peucker (ADR 0012).
public static class SimplificationInheritance
Inherited Members
Methods
Simplify(IPolyline2D, double, bool, IGeometryFactory?)
Simplifies each path by Douglas-Peucker: a vertex is kept if it is farther than
tolerance from the chord. Start and end point are kept; the
remaining vertices are unchanged (including Z and M). With preserveTopology no new
crossings arise between or within the paths (as in JTS TopologyPreservingSimplifier).
public static IPolyline2D Simplify(this IPolyline2D polyline, double tolerance, bool preserveTopology = false, IGeometryFactory? factory = null)Parameters
polylineIPolyline2D-
The polyline.
tolerancedouble-
The tolerance in map units, ≥ 0.
preserveTopologybool-
Simplify while preserving topology.
factoryIGeometryFactory?-
The factory;
null= SpatialNET.GeometryFactory.Default.
Returns
Exceptions
- ArgumentNullException
-
polylineisnull. - ArgumentOutOfRangeException
-
toleranceis negative or not finite. - InvalidOperationException
-
No factory available.
Simplify(IPolygon2D, double, bool, IGeometryFactory?, double?)
Simplifies the rings of the polygon by Douglas-Peucker (the ring start point may also be dropped); rings with
fewer than 4 points are dropped. The result is normalized by the overlay and is always valid
(ADR 0003/0012). With preserveTopology no rings are lost and no
crossings arise (as in JTS TopologyPreservingSimplifier).
public static IPolygon2D Simplify(this IPolygon2D polygon, double tolerance, bool preserveTopology = false, IGeometryFactory? factory = null, double? gridSize = null)Parameters
polygonIPolygon2D-
The polygon.
tolerancedouble-
The tolerance in map units, ≥ 0.
preserveTopologybool-
Simplify while preserving topology.
factoryIGeometryFactory?-
The factory;
null= SpatialNET.GeometryFactory.Default. gridSizedouble?-
The grid size of the normalization;
null= cascade (global default, otherwise automatic).
Returns
Exceptions
- ArgumentNullException
-
polygonisnull. - ArgumentOutOfRangeException
-
toleranceis negative or not finite.