Implements the algorithsm required to compute the isValid()
method for Geometrys.
More...
#include <IsValidOp.h>
Implements the algorithsm required to compute the isValid()
method for Geometrys.
Definition at line 61 of file IsValidOp.h.
geos::operation::valid::IsValidOp::IsValidOp |
( |
const geom::Geometry * |
geom | ) |
|
|
inline |
virtual geos::operation::valid::IsValidOp::~IsValidOp |
( |
| ) |
|
|
inlinevirtual |
TODO: validErr can't be a pointer!
Definition at line 205 of file IsValidOp.h.
void geos::operation::valid::IsValidOp::checkClosedRing |
( |
const geom::LinearRing * |
ring | ) |
|
|
private |
void geos::operation::valid::IsValidOp::checkClosedRings |
( |
const geom::Polygon * |
poly | ) |
|
|
private |
Test that each hole is inside the polygon shell. This routine assumes that the holes have previously been tested to ensure that all vertices lie on the shell or inside it. A simple test of a single point in the hole can be used, provide the point is chosen such that it does not lie on the boundary of the shell.
- Parameters
-
Tests that no hole is nested inside another hole. This routine assumes that the holes are disjoint. To ensure this, holes have previously been tested to ensure that:
- they do not partially overlap (checked by
checkRelateConsistency
)
- they are not identical (checked by
checkRelateConsistency
)
void geos::operation::valid::IsValidOp::checkInvalidCoordinates |
( |
const geom::Polygon * |
poly | ) |
|
|
private |
check that a ring does not self-intersect, except at its endpoints. Algorithm is to count the number of times each node along edge occurs. If any occur more than once, that must be a self-intersection.
Check that there is no ring which self-intersects (except of course at its endpoints). This is required by OGC topology rules (but not by other models such as ESRI SDE, which allow inverted shells and exverted holes).
- Parameters
-
graph | the topology graph of the geometry |
Tests that no element polygon is wholly in the interior of another element polygon.
Preconditions:
- shells do not partially overlap
- shells do not touch along an edge
- no duplicate rings exist
This routine relies on the fact that while polygon shells may touch at one or more vertices, they cannot touch at ALL vertices.
void geos::operation::valid::IsValidOp::checkValid |
( |
| ) |
|
|
private |
void geos::operation::valid::IsValidOp::checkValid |
( |
const geom::Geometry * |
g | ) |
|
|
private |
void geos::operation::valid::IsValidOp::checkValid |
( |
const geom::Point * |
g | ) |
|
|
private |
void geos::operation::valid::IsValidOp::checkValid |
( |
const geom::LinearRing * |
g | ) |
|
|
private |
void geos::operation::valid::IsValidOp::checkValid |
( |
const geom::LineString * |
g | ) |
|
|
private |
void geos::operation::valid::IsValidOp::checkValid |
( |
const geom::Polygon * |
g | ) |
|
|
private |
Find a point from the list of testCoords that is NOT a node in the edge for the list of searchCoords.
- Returns
- the point found, or NULL if none found
static bool geos::operation::valid::IsValidOp::isValid |
( |
const geom::Coordinate & |
coord | ) |
|
|
static |
Checks whether a coordinate is valid for processing. Coordinates are valid iff their x and y coordinates are in the range of the floating point representation.
- Parameters
-
coord | the coordinate to validate |
- Returns
true
if the coordinate is valid
static bool geos::operation::valid::IsValidOp::isValid |
( |
const geom::Geometry & |
geom | ) |
|
|
static |
Tests whether a geom::Geometry is valid.
- Parameters
-
- Returns
true
if the geometry is valid
bool geos::operation::valid::IsValidOp::isValid |
( |
| ) |
|
void geos::operation::valid::IsValidOp::setSelfTouchingRingFormingHoleValid |
( |
bool |
p_isValid | ) |
|
|
inline |
Sets whether polygons using Self-Touching Rings to form holes are reported as valid.
If this flag is set, the following Self-Touching conditions are treated as being valid:
- the shell ring self-touches to create a hole touching the shell
- a hole ring self-touches to create two holes touching at a point
The default (following the OGC SFS standard) is that this condition is not valid (false
).
This does not affect whether Self-Touching Rings disconnecting the polygon interior are considered valid (these are considered to be invalid under the SFS, and many other spatial models as well). This includes "bow-tie" shells, which self-touch at a single point causing the interior to be disconnected, and "C-shaped" holes which self-touch at a single point causing an island to be formed.
- Parameters
-
p_isValid | states whether geometry with this condition is valid |
Definition at line 238 of file IsValidOp.h.
bool geos::operation::valid::IsValidOp::isChecked |
|
private |
bool geos::operation::valid::IsValidOp::isSelfTouchingRingFormingHoleValid |
|
private |
const geom::Geometry* geos::operation::valid::IsValidOp::parentGeometry |
|
private |
the base Geometry to be validated
Definition at line 65 of file IsValidOp.h.
The documentation for this class was generated from the following file: