diff --git a/modules/core/src/main/java/org/locationtech/jts/operation/relateng/NodeSections.java b/modules/core/src/main/java/org/locationtech/jts/operation/relateng/NodeSections.java index 9ee4a5c50..c1a7ea96f 100644 --- a/modules/core/src/main/java/org/locationtech/jts/operation/relateng/NodeSections.java +++ b/modules/core/src/main/java/org/locationtech/jts/operation/relateng/NodeSections.java @@ -68,29 +68,31 @@ public RelateNode createNode() { RelateNode node = new RelateNode(nodePt); int i = 0; while (i < sections.size()) { - int blockSize = 1; NodeSection ns = sections.get(i); //-- if there multiple polygon sections incident at node convert them to maximal-ring structure if (ns.isArea() && hasMultiplePolygonSections(sections, i)) { List polySections = collectPolygonSections(sections, i); List nsConvert = PolygonNodeConverter.convert(polySections); node.addEdges(nsConvert); - blockSize = polySections.size(); + i += polySections.size(); } else { //-- the most common case is a line or a single polygon ring section node.addEdges(ns); + i += 1; } - i += blockSize; } return node; } + /** + * Sorts the sections so that: + * + */ private void prepareSections() { - /** - * Sort sections with lines before areas, - * and edges for polygons are together. - */ sections.sort(null); //TODO: remove duplicate sections }