Class ConsistentAreaTester
- java.lang.Object
-
- org.locationtech.jts.operation.valid.ConsistentAreaTester
-
public class ConsistentAreaTester extends java.lang.Object
Checks that aGeometryGraph
representing an area (aPolygon
orMultiPolygon
) 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:
- test for rings which properly intersect (but not for ring self-intersection, or intersections at vertices)
- test for consistent labelling at all node points (this detects vertex intersections with invalid topology, i.e. where the exterior side of an edge lies in the interior of the area)
- test for duplicate rings
- Version:
- 1.7
-
-
Field Summary
Fields Modifier and Type Field Description private GeometryGraph
geomGraph
private Coordinate
invalidPoint
private LineIntersector
li
private RelateNodeGraph
nodeGraph
-
Constructor Summary
Constructors Constructor Description ConsistentAreaTester(GeometryGraph geomGraph)
Creates a new tester for consistent areas.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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.
-
-
-
Field Detail
-
li
private final LineIntersector li
-
geomGraph
private GeometryGraph geomGraph
-
nodeGraph
private RelateNodeGraph nodeGraph
-
invalidPoint
private Coordinate invalidPoint
-
-
Constructor Detail
-
ConsistentAreaTester
public ConsistentAreaTester(GeometryGraph geomGraph)
Creates a new tester for consistent areas.- Parameters:
geomGraph
- the topology graph of the area geometry
-
-
Method Detail
-
getInvalidPoint
public Coordinate getInvalidPoint()
- Returns:
- the intersection point, or
null
if none was found
-
isNodeConsistentArea
public boolean isNodeConsistentArea()
Check all nodes to see if their labels are consistent with area topology.- Returns:
true
if this area has a consistent node labelling
-
isNodeEdgeAreaLabelsConsistent
private boolean isNodeEdgeAreaLabelsConsistent()
Check all nodes to see if their labels are consistent. If any are not, return false- Returns:
true
if the edge area labels are consistent at this node
-
hasDuplicateRings
public boolean hasDuplicateRings()
Checks for two duplicate rings in an area. Duplicate rings are rings that are topologically equal (that is, which have the same sequence of points up to point order). If the area is topologically consistent (determined by calling theisNodeConsistentArea
, 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.- Returns:
- true if this area Geometry is topologically consistent but has two duplicate rings
-
-