Class ConnectedInteriorTester


  • public class ConnectedInteriorTester
    extends java.lang.Object
    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
    If a disconnected situation is found the location of the problem is recorded.
    Version:
    1.7
    • Constructor Detail

      • ConnectedInteriorTester

        public ConnectedInteriorTester​(GeometryGraph geomGraph)
    • Method Detail

      • getCoordinate

        public Coordinate getCoordinate()
      • isInteriorsConnected

        public boolean isInteriorsConnected()
      • setInteriorEdgesInResult

        private void setInteriorEdgesInResult​(PlanarGraph graph)
      • buildEdgeRings

        private java.util.List buildEdgeRings​(java.util.Collection dirEdges)
        Form DirectedEdges in graph into Minimal EdgeRings. (Minimal Edgerings must be used, because only they are guaranteed to provide a correct isHole computation)
      • visitShellInteriors

        private void visitShellInteriors​(Geometry g,
                                         PlanarGraph graph)
        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.
      • visitLinkedDirectedEdges

        protected void visitLinkedDirectedEdges​(DirectedEdge start)
      • hasUnvisitedShellEdge

        private boolean hasUnvisitedShellEdge​(java.util.List edgeRings)
        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