Table of Contents

Class Simplification

Namespace
SpatialNET
Assembly
SpatialNET.Extensions.dll

Simplification by Douglas-Peucker (ADR 0012).

public static class Simplification

Inheritance

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

polyline IPolyline2D

The polyline.

tolerance double

The tolerance in map units, ≥ 0.

preserveTopology bool

Simplify while preserving topology.

factory IGeometryFactory?

The factory; null = SpatialNET.GeometryFactory.Default.

Returns

IPolyline2D

Exceptions

ArgumentNullException

polyline is null.

ArgumentOutOfRangeException

tolerance is 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

polygon IPolygon2D

The polygon.

tolerance double

The tolerance in map units, ≥ 0.

preserveTopology bool

Simplify while preserving topology.

factory IGeometryFactory?

The factory; null = SpatialNET.GeometryFactory.Default.

gridSize double?

The grid size of the normalization; null = cascade (global default, otherwise automatic).

Returns

IPolygon2D

Exceptions

ArgumentNullException

polygon is null.

ArgumentOutOfRangeException

tolerance is negative or not finite.