Class ConnectedInteriorTester
java.lang.Object
org.locationtech.jts.operation.valid.ConnectedInteriorTester
This class tests that the interior of an area
Geometry
( Polygon or MultiPolygon )
is connected.
This can happen if:
- a shell self-intersects
- one or more holes form a connected chain touching a shell at two different points
- one or more holes form a ring around a subset of the interior
- Version:
- 1.7
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Coordinateprivate GeometryFactoryprivate GeometryGraph -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate ListbuildEdgeRings(Collection dirEdges) Form DirectedEdges in graph into Minimal EdgeRings.static CoordinatefindDifferentPoint(Coordinate[] coord, Coordinate pt) private booleanhasUnvisitedShellEdge(List edgeRings) Check if any shell ring has an unvisited edge.booleanprivate voidprivate voidvisitInteriorRing(LineString ring, PlanarGraph graph) protected voidprivate voidvisitShellInteriors(Geometry g, PlanarGraph graph) Mark all the edges for the edgeRings corresponding to the shells of the input polygons.
-
Field Details
-
geometryFactory
-
geomGraph
-
disconnectedRingcoord
-
-
Constructor Details
-
ConnectedInteriorTester
-
-
Method Details
-
findDifferentPoint
-
getCoordinate
-
isInteriorsConnected
public boolean isInteriorsConnected() -
setInteriorEdgesInResult
-
buildEdgeRings
Form DirectedEdges in graph into Minimal EdgeRings. (Minimal Edgerings must be used, because only they are guaranteed to provide a correct isHole computation) -
visitShellInteriors
Mark all the edges for the edgeRings corresponding to the shells of the input polygons. Only ONE ring gets marked for each shell - if there are others which remain unmarked this indicates a disconnected interior. -
visitInteriorRing
-
visitLinkedDirectedEdges
-
hasUnvisitedShellEdge
Check if any shell ring has an unvisited edge. A shell ring is a ring which is not a hole and which has the interior of the parent area on the RHS. (Note that there may be non-hole rings with the interior on the LHS, since the interior of holes will also be polygonized into CW rings by the linkAllDirectedEdges() step)- Returns:
- true if there is an unvisited edge in a non-hole ring
-