visitInteriorRing method

void visitInteriorRing(
  1. LineString ring,
  2. PlanarGraph graph
)

Implementation

void visitInteriorRing(LineString ring, PlanarGraph graph) {
  if (ring.isEmpty()) return;
  List<Coordinate> pts = ring.getCoordinates();
  Coordinate pt0 = pts[0];
  /**
   * Find first point in coord list different to initial point.
   * Need special check since the first point may be repeated.
   */
  Coordinate pt1 = findDifferentPoint(pts, pt0)!;
  Edge e = graph.findEdgeInSameDirection(pt0, pt1)!;
  DirectedEdge de = graph.findEdgeEnd(e) as DirectedEdge;
  DirectedEdge? intDe = null;
  if (de.getLabel()!.getLocationWithPosIndex(0, Position.RIGHT) ==
      Location.INTERIOR) {
    intDe = de;
  } else if (de
          .getSym()
          .getLabel()!
          .getLocationWithPosIndex(0, Position.RIGHT) ==
      Location.INTERIOR) {
    intDe = de.getSym();
  }
  Assert.isTrue(intDe != null, "unable to find dirEdge with Interior on RHS");

  visitLinkedDirectedEdges(intDe!);
}