Class CoverageSimplifier
Simplifies the boundaries of the polygons in a polygonal coverage while preserving the original coverage topology. An area-based simplification algorithm (similar to Visvalingam-Whyatt simplification) is used to provide high-quality results. Also supports simplifying just the inner edges in a coverage, which allows simplifying "patches" without affecting their boundary.
The amount of simplification is determined by a tolerance value, which is a non-negative quantity. It equates roughly to the maximum distance by which a simplified line can change from the original. (In fact, it is the square root of the area tolerance used in the Visvalingam-Whyatt algorithm.) The simplified result coverage has the following characteristics:- It has the same number of polygonal geometries as the input
- If the input is a valid coverage, then so is the result
- Node points (inner vertices shared by three or more polygons, or boundary vertices shared by two or more) are not changed
- Polygons maintain their line-adjacency (edges are never removed)
- Rings are simplified to a minimum of 4 vertices, to better preserve their shape
- Rings smaller than the area tolerance are removed where possible. This applies to both holes and "islands" (multipolygon elements which are disjoint or touch another polygon at a single vertex). At least one polygon is retained for each input geometry (the one with largest area).
Due to different implementations of the
PriorityQueue
classes used in JTS and NTS
the results of the CoverageSimplifier
's simplification methods are not guaranteed
to be the same. Nonetheless both results are valid.
Inherited Members
Namespace: NetTopologySuite.Coverage
Assembly: NetTopologySuite.dll
Syntax
public sealed class CoverageSimplifier
Remarks
FUTURE WORK
Constructors
| Edit this page View SourceCoverageSimplifier(Geometry[])
Create a new coverage simplifier instance.
Declaration
public CoverageSimplifier(Geometry[] coverage)
Parameters
Type | Name | Description |
---|---|---|
Geometry[] | coverage | A set of polygonal geometries forming a coverage |
Properties
| Edit this page View SourceRemovableRingSizeFactor
Gets or sets a value indicating the factor
applied to the area tolerance to determine
if small rings should be removed.
Larger values cause more rings to be removed.
A value of 0
prevents rings from being removed.
Declaration
public double RemovableRingSizeFactor { get; set; }
Property Value
Type | Description |
---|---|
double |
SmoothWeight
Gets or sets a value inidcating the weight influencing how smooth the simplification should be. The weight must be between 0 and 1. Larger values increase the smoothness of the simplified edges.
Declaration
public double SmoothWeight { get; set; }
Property Value
Type | Description |
---|---|
double |
Methods
| Edit this page View SourceSimplify(Geometry[], double)
Simplifies the boundaries of a set of polygonal geometries forming a coverage, preserving the coverage topology.
Declaration
public static Geometry[] Simplify(Geometry[] coverage, double tolerance)
Parameters
Type | Name | Description |
---|---|---|
Geometry[] | coverage | A set of polygonal geometries forming a coverage |
double | tolerance | The simplification tolerance |
Returns
Type | Description |
---|---|
Geometry[] | The simplified coverage polygons |
Simplify(Geometry[], double[])
Simplifies the boundaries of a set of polygonal geometries forming a coverage, preserving the coverage topology, using a separate tolerance for each element of the coverage. Coverage edges are simplified using the lowest tolerance of each adjacent element.
Declaration
public static Geometry[] Simplify(Geometry[] coverage, double[] tolerances)
Parameters
Type | Name | Description |
---|---|---|
Geometry[] | coverage | A set of polygonal geometries forming a coverage |
double[] | tolerances | The simplification tolerances (one per input element) |
Returns
Type | Description |
---|---|
Geometry[] | The simplified coverage polygons |
Simplify(double)
Computes the simplified coverage using a single distance tolerance, preserving the coverage topology.
Declaration
public Geometry[] Simplify(double tolerance)
Parameters
Type | Name | Description |
---|---|---|
double | tolerance | The simplification distance tolerance |
Returns
Type | Description |
---|---|
Geometry[] | The simplified coverage polygons |
Simplify(double, double)
Computes the simplified coverage using separate distance tolerances for inner and outer edges, preserving the coverage topology.
Declaration
public Geometry[] Simplify(double toleranceInner, double toleranceOuter)
Parameters
Type | Name | Description |
---|---|---|
double | toleranceInner | The distance tolerance for inner edges |
double | toleranceOuter | The distance tolerance for outer edges |
Returns
Type | Description |
---|---|
Geometry[] | The simplified coverage polygons |
Simplify(double[])
Computes the simplified coverage using separate distance tolerances for each coverage element, preserving the coverage topology.
Declaration
public Geometry[] Simplify(double[] tolerances)
Parameters
Type | Name | Description |
---|---|---|
double[] | tolerances | the distance tolerances for the coverage elements |
Returns
Type | Description |
---|---|
Geometry[] | The simplified coverage polygons |
SimplifyInner(Geometry[], double)
Simplifies the inner boundaries of a set of polygonal geometries forming a coverage, preserving the coverage topology. Edges which form the exterior boundary of the coverage are left unchanged.
Declaration
public static Geometry[] SimplifyInner(Geometry[] coverage, double tolerance)
Parameters
Type | Name | Description |
---|---|---|
Geometry[] | coverage | A set of polygonal geometries forming a coverage |
double | tolerance | The simplification tolerance |
Returns
Type | Description |
---|---|
Geometry[] | The simplified coverage polygons |
SimplifyOuter(Geometry[], double)
Simplifies the outer boundaries of a set of polygonal geometries forming a coverage, preserving the coverage topology. Edges in the interior of the coverage are left unchanged.
Declaration
public static Geometry[] SimplifyOuter(Geometry[] coverage, double tolerance)
Parameters
Type | Name | Description |
---|---|---|
Geometry[] | coverage | A set of polygonal geometries forming a coverage |
double | tolerance | The simplification tolerance |
Returns
Type | Description |
---|---|
Geometry[] | The simplified coverage polygons |