Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dedicated handling of touching inner rings in multipoygons #249

Merged
merged 8 commits into from
Nov 3, 2020

Conversation

tyrasd
Copy link
Member

@tyrasd tyrasd commented Jun 17, 2020

The previous workaround of using buffer(0) to let JTS join any touching inner rings can be very slow, up to the point of potentially bringing a query to an almost complete halt when it has to be called on very large multipolygons (e.g. relation/1205151).

This adds dedicated handling of touching inner rings, and merges them before the geometry object is created.

A few test cases were adjusted, because the new handling is following more strictly the multipolygon validity rules given in the osm wiki. (related: #123, #129)

Also includes some minor code cleanup (e.g. adding of a private construtor to the static geometry builder utility class to hide the implicit public constructor).

Checklist

@tyrasd tyrasd added the performance Performance optimizations, bottlenecks of the current pipeline, etc. label Jun 17, 2020
@tyrasd tyrasd added this to the release 0.6.0 milestone Jun 17, 2020
The previous workaround of using `buffer(0)` to let JTS join any
touching inner rings can be very slow, up to the point of
potentially bringing a query to an almost complete halt when it
has to be called on very large multipolygons (e.g. relation 1205151).

This adds dedicated handling of touching inner rings, and merges
them before the geometry object is created.

A few test cases were adjusted, because the new handling is
following more strictly the multipolygon validity rules given
in the osm wiki.

Also includes some minor code cleanup (e.g. adding of a private
construtor to the static geometry builder utility class to hide
the implicit public constructor).
@joker234 joker234 force-pushed the improve-touching-inners-handling branch from da3ffbe to 48f0b98 Compare October 30, 2020 12:39
Copy link
Member

@joker234 joker234 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some open points need to be considered, mostly questions or suggestions.

@joker234
Copy link
Member

@tyrasd I checked all finished points of your checklist above. Can you think about whether we need to do the remaining ones (benchmarks, changelog, examples, documentation)

Co-authored-by: Johannes Visintini <johannes.visintini@heigit.org>
@tyrasd
Copy link
Member Author

tyrasd commented Oct 30, 2020

@tyrasd I checked all finished points of your checklist above. Can you think about whether we need to do the remaining ones (benchmarks, changelog, examples, documentation)

I would definitely add this to the changelog. additional benchmarks would be nice, but let's see if we find time for that. documentation/examples are probably not needed, since the API stayed the same.

also refactor some parts of the code to make it slightly more readable (hopefully).
@tyrasd tyrasd requested a review from joker234 November 2, 2020 19:46
@joker234 joker234 merged commit fdf18c1 into master Nov 3, 2020
@joker234 joker234 deleted the improve-touching-inners-handling branch November 3, 2020 15:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Performance optimizations, bottlenecks of the current pipeline, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants