Skip to content

Conversation

@arriopolis
Copy link

This PR adds a spatial filter to the polygonbuilder that is part of overlayng. This was already suggested in a comment present in the previous version.

I did some performance measurements too, to see how much time it saves. For the tests, I computed the difference between two MultiPolygons, one being a region and the other being lakes and rivers inside that region, both taken from OpenStreetMaps. Here are the performance results:

Region Old time (ms) New time (ms) Data set
Zuid-Holland 194 189 zuid-holland.zip
Netherlands 902 903 netherlands.zip
Spain 1286 1168 spain.zip
Germany 2774 2163 germany.zip
France 4489 3322 *

*The data set for France is too big to upload, it's available upon request.

For the measurements, I took the average of five runs. I also checked that the areas of the resulting shapes match exactly in both runs.

@dr-jts dr-jts changed the title Added a spatial index to the overlayng polygon builder. Added spatial index to the OverlayNG PolygonBuilder Jan 12, 2026
@dr-jts dr-jts changed the title Added spatial index to the OverlayNG PolygonBuilder Added spatial index to OverlayNG PolygonBuilder.placeFreeHoles Jan 12, 2026
@dr-jts
Copy link
Contributor

dr-jts commented Jan 12, 2026

Looks like a good improvement. Is there a particular reason you chose to use HPRTree - e.g. performance or memory usage? (It does seem like a good choice - just curious if you compared it to say STRtree).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants