diff --git a/modules/core/src/main/java/org/locationtech/jts/algorithm/hull/OuterShellsExtracter.java b/modules/core/src/main/java/org/locationtech/jts/algorithm/hull/OuterShellsExtracter.java index daf8000fc1..f52da0b437 100644 --- a/modules/core/src/main/java/org/locationtech/jts/algorithm/hull/OuterShellsExtracter.java +++ b/modules/core/src/main/java/org/locationtech/jts/algorithm/hull/OuterShellsExtracter.java @@ -46,12 +46,12 @@ public OuterShellsExtracter(Geometry polygons) { private LinearRing[] extractShells() { LinearRing[] shells = extractShellRings(polygons); - /** - * sort shells in order of increasing envelope area - * to ensure that shells are added before any of their inner shells - */ + + //-- sort shells in order of increasing envelope area Arrays.sort(shells, new EnvelopeAreaComparator()); List outerShells = new ArrayList(); + + //-- Scan shells by decreasing area to ensure that shells are added before any nested shells for (int i = shells.length - 1; i >= 0; i--) { LinearRing shell = shells[i]; if (outerShells.size() == 0