Fix TaggedLineString to return a valid component point for simplified lines. This fixes some cases which can cause TopologyPreservingSimplifier to "jump" components and create invalid geometry.
No unit tests are provided, since it has not been possible to create a simple reproducer. The issue was seen in test case 19 from https://github.com/libgeos/geos/issues/1180. If this is simplified with tolerance 0.01 a hole is left outside the simplified shell.
One thing preventing creating a simple test case is that TopologyPreservingSimplifier is non-deterministic in the order of simplifying rings. It would be good to change to a deterministic evaluation order, to allow simpler test cases and provide consistency across JTS derivatives such as GEOS.
Fix
TaggedLineString
to return a valid component point for simplified lines. This fixes some cases which can causeTopologyPreservingSimplifier
to "jump" components and create invalid geometry.No unit tests are provided, since it has not been possible to create a simple reproducer. The issue was seen in test case 19 from https://github.com/libgeos/geos/issues/1180. If this is simplified with tolerance 0.01 a hole is left outside the simplified shell.
network-as-polygon-edgecase-19.txt
One thing preventing creating a simple test case is that
TopologyPreservingSimplifier
is non-deterministic in the order of simplifying rings. It would be good to change to a deterministic evaluation order, to allow simpler test cases and provide consistency across JTS derivatives such as GEOS.