Class ConnectedInteriorTester

java.lang.Object
org.locationtech.jts.operation.valid.ConnectedInteriorTester

public class ConnectedInteriorTester extends 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
  • Field Details

  • Constructor Details

    • ConnectedInteriorTester

      public ConnectedInteriorTester(GeometryGraph geomGraph)
  • Method Details

    • findDifferentPoint

      public static Coordinate findDifferentPoint(Coordinate[] coord, Coordinate pt)
    • getCoordinate

      public Coordinate getCoordinate()
    • isInteriorsConnected

      public boolean isInteriorsConnected()
    • setInteriorEdgesInResult

      private void setInteriorEdgesInResult(PlanarGraph graph)
    • buildEdgeRings

      private List buildEdgeRings(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.
    • visitInteriorRing

      private void visitInteriorRing(LineString ring, PlanarGraph graph)
    • visitLinkedDirectedEdges

      protected void visitLinkedDirectedEdges(DirectedEdge start)
    • hasUnvisitedShellEdge

      private boolean hasUnvisitedShellEdge(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