Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix infinite loop in polygonizer issue 874 #968

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Original file line number Diff line number Diff line change
Expand Up @@ -296,16 +296,23 @@ private static void findDisjointShells(List<EdgeRing> shellList) {
findOuterShells(shellList);

boolean isMoreToScan;
int lastUnsetNumber = -1;
do {
isMoreToScan = false;
int unsetNumber = 0;
for (EdgeRing er : shellList) {
if (er.isIncludedSet())
continue;
unsetNumber++;
er.updateIncluded();
if (! er.isIncludedSet()) {
isMoreToScan = true;
}
}
if (unsetNumber > 0 && unsetNumber == lastUnsetNumber) {
throw new IllegalStateException("Failed to polygonize with extractOnlyPolygonal option : input may not be correctly noded");
}
lastUnsetNumber = unsetNumber;
} while (isMoreToScan);
}

Expand Down
Loading