Class CoverageValidator
Validates a polygonal coverage, and returns the locations of invalid polygon boundary segments if found.
A polygonal coverage is a set of polygons which may be edge-adjacent but do not overlap. Coverage algorithms(such as { @link CoverageUnion} or simplification) generally require the input coverage to be valid to produce correct results. A polygonal coverage is valid if:- The interiors of all polygons do not intersect(are disjoint). This is the case if no polygon has a boundary which intersects the interior of another polygon, and no two polygons are identical.
- If the boundaries of polygons intersect, the vertices and line segments of the intersection match exactly.
Inherited Members
Namespace: NetTopologySuite.Coverage
Assembly: NetTopologySuite.dll
Syntax
public class CoverageValidator
Constructors
| Edit this page View SourceCoverageValidator(Geometry[])
Creates a new coverage validator
Declaration
public CoverageValidator(Geometry[] coverage)
Parameters
| Type | Name | Description |
|---|---|---|
| Geometry[] | coverage | An array of polygons representing a polygonal coverage |
Properties
| Edit this page View SourceGapWidth
Gets or sets a value indicating the maximum gap, if narrow gaps are to be detected.
Declaration
public double GapWidth { get; set; }
Property Value
| Type | Description |
|---|---|
| double |
Methods
| Edit this page View SourceHasInvalidResult(Geometry[])
Tests if some element of an array of geometries is a coverage invalidity indicator.
Declaration
public static bool HasInvalidResult(Geometry[] validateResult)
Parameters
| Type | Name | Description |
|---|---|---|
| Geometry[] | validateResult | An array produced by a polygonal coverage validation |
Returns
| Type | Description |
|---|---|
| bool |
|
IsValid(Geometry[])
Tests whether a polygonal coverage is valid.
Declaration
public static bool IsValid(Geometry[] coverage)
Parameters
| Type | Name | Description |
|---|---|---|
| Geometry[] | coverage | An array of polygons forming a coverage |
Returns
| Type | Description |
|---|---|
| bool |
|
Remarks
Named isValid in JTS
Validate()
Validates the polygonal coverage. The result is an array of the same size as the input coverage. Each array entry is either null, or if the polygon does not form a valid coverage, a linear geometry containing the boundary segments which intersect polygon interiors, which are mismatched, or form gaps (if checked).
Declaration
public Geometry[] Validate()
Returns
| Type | Description |
|---|---|
| Geometry[] | An array of nulls or linear geometries |
Validate(Geometry[])
Validates that a set of polygons forms a valid polygonal coverage, and returns linear geometries indicating the locations of invalidities, if any.
Declaration
public static Geometry[] Validate(Geometry[] coverage)
Parameters
| Type | Name | Description |
|---|---|---|
| Geometry[] | coverage | An array of polygons forming a coverage |
Returns
| Type | Description |
|---|---|
| Geometry[] | An array of linear geometries indicating coverage errors, or nulls |
Validate(Geometry[], double)
Validates that a set of polygons forms a valid polygonal coverage and contains no gaps narrower than a specified width. The result is an array of linear geometries indicating the locations of invalidities, or null if the polygon is coverage-valid.
Declaration
public static Geometry[] Validate(Geometry[] coverage, double gapWidth)
Parameters
| Type | Name | Description |
|---|---|---|
| Geometry[] | coverage | An array of polygons forming a coverage |
| double | gapWidth | The maximum width of invalid gaps |
Returns
| Type | Description |
|---|---|
| Geometry[] | An array of linear geometries indicating coverage errors, or nulls |