GEOS 3.14.0dev
|
#include <CoverageValidator.h>
Public Member Functions | |
CoverageValidator (std::vector< const Geometry * > &coverage) | |
void | setGapWidth (double gapWidth) |
std::vector< std::unique_ptr< Geometry > > | validate () |
Static Public Member Functions | |
static bool | isValid (std::vector< const Geometry * > &coverage) |
static bool | hasInvalidResult (const std::vector< std::unique_ptr< Geometry > > &validateResult) |
static std::vector< std::unique_ptr< Geometry > > | validate (std::vector< const Geometry * > &coverage) |
static std::vector< std::unique_ptr< Geometry > > | validate (std::vector< const Geometry * > &coverage, double gapWidth) |
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 CoverageUnion
or simplification) generally require the input coverage to be valid to produce correct results. A polygonal coverage is valid if:
A valid coverage may contain holes (regions of no coverage). Sometimes it is desired to detect whether coverages contain narrow gaps between polygons (which can be a result of digitizing error or misaligned data). This class can detect narrow gaps, by specifying a maximum gap width using setGapWidth(double)
. Note that this also identifies narrow gaps separating disjoint coverage regions, and narrow gores. In some situations it may also produce false positives (linework identified as part of a gap which is actually wider). See CoverageGapFinder for an alternate way to detect gaps which may be more accurate.
|
static |
Tests if some element of an array of geometries is a coverage invalidity indicator.
validateResult | an array produced by a polygonal coverage validation |
|
static |
Tests whether a polygonal coverage is valid.
coverage | an array of polygons forming a coverage |
|
inline |
Sets the maximum gap width, if narrow gaps are to be detected.
gapWidth | the maximum width of gaps to detect |
std::vector< std::unique_ptr< Geometry > > geos::coverage::CoverageValidator::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).
|
static |
Validates that a set of polygons forms a valid polygonal coverage. The result is a list of the same length as the input, containing for each input geometry either a linear geometry indicating the locations of invalidities, or a null if the geometry is coverage-valid.
coverage | an array of polygons forming a coverage |
|
static |
Validates that a set of polygons forms a valid polygonal coverage and contains no gaps narrower than a specified width. The result is a list of the same length as the input, containing for each input geometry either a linear geometry indicating the locations of invalidities, or a null if the geometry is coverage-valid.
coverage | an array of polygons forming a coverage |
gapWidth | the maximum width of invalid gaps |