public class ConsistentAreaTester
extends java.lang.Object
GeometryGraph
representing an area
(a Polygon
or MultiPolygon
)
has consistent semantics for area geometries.
This check is required for any reasonable polygonal model
(including the OGC-SFS model, as well as models which allow ring self-intersection at single points)
Checks include:
Modifier and Type | Field and Description |
---|---|
private GeometryGraph |
geomGraph |
private Coordinate |
invalidPoint |
private LineIntersector |
li |
private RelateNodeGraph |
nodeGraph |
Constructor and Description |
---|
ConsistentAreaTester(GeometryGraph geomGraph)
Creates a new tester for consistent areas.
|
Modifier and Type | Method and Description |
---|---|
Coordinate |
getInvalidPoint() |
boolean |
hasDuplicateRings()
Checks for two duplicate rings in an area.
|
boolean |
isNodeConsistentArea()
Check all nodes to see if their labels are consistent with area topology.
|
private boolean |
isNodeEdgeAreaLabelsConsistent()
Check all nodes to see if their labels are consistent.
|
private final LineIntersector li
private GeometryGraph geomGraph
private RelateNodeGraph nodeGraph
private Coordinate invalidPoint
public ConsistentAreaTester(GeometryGraph geomGraph)
geomGraph
- the topology graph of the area geometrypublic Coordinate getInvalidPoint()
null
if none was foundpublic boolean isNodeConsistentArea()
true
if this area has a consistent node labellingprivate boolean isNodeEdgeAreaLabelsConsistent()
true
if the edge area labels are consistent at this nodepublic boolean hasDuplicateRings()
isNodeConsistentArea
,
duplicate rings can be found by checking for EdgeBundles which contain
more than one EdgeEnd.
(This is because topologically consistent areas cannot have two rings sharing
the same line segment, unless the rings are equal).
The start point of one of the equal rings will be placed in
invalidPoint.