locationtech / jts

The JTS Topology Suite is a Java library for creating and manipulating vector geometry.
Other
1.94k stars 441 forks source link

Improve code for finding contained EdgeRings #906

Closed dr-jts closed 2 years ago

dr-jts commented 2 years ago

This improves the code for finding containing EdgeRings in Polygonizer and OverlayNG. The original code was confusing, and inefficient in some cases.

The performance of Polygonizer is improved in cases where there are many small islands near a larger polygon, by eliminating a linear scan of the larger polygon vertices. In the case of polygonizing the merged world.wkt file, performance is improved by almost 50%.

There is not expected to be much performance improvement for OverlayNG, since it is able to avoid testing islands as holes due to more available topology information.

The change is not being made for the old overlay code, since this is obsolete.

Signed-off-by: Martin Davis mtnclimb@gmail.com