placePolygonHoles method

void placePolygonHoles(
  1. EdgeRing shell,
  2. List minEdgeRings
)

This method assigns the holes for a Polygon (formed from a list of MinimalEdgeRings) to its shell. Determining the holes for a MinimalEdgeRing polygon serves two purposes:

  • it is faster than using a point-in-polygon check later on.
  • it ensures correctness, since if the PIP test was used the point chosen might lie on the shell, which might return an incorrect result from the PIP test

Implementation

void placePolygonHoles(EdgeRing shell, List minEdgeRings) {
  for (MinimalEdgeRing er in minEdgeRings) {
    if (er.isHole()) {
      er.setShell(shell);
    }
  }
}