checkShellsNotNested method
Tests that no element polygon is wholly in the interior of another element polygon.
Preconditions:
- shells do not partially overlap
- shells do not touch along an edge
- no duplicate rings exist
Implementation
void checkShellsNotNested(MultiPolygon mp, GeometryGraph graph) {
for (int i = 0; i < mp.getNumGeometries(); i++) {
Polygon p = mp.getGeometryN(i) as Polygon;
LinearRing shell = p.getExteriorRing();
for (int j = 0; j < mp.getNumGeometries(); j++) {
if (i == j) continue;
Polygon p2 = mp.getGeometryN(j) as Polygon;
checkShellNotNested(shell, p2, graph);
if (validErr != null) return;
}
}
}