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

self-intersection aware simplify #880

Open
kleunen opened this issue Jul 3, 2021 · 2 comments
Open

self-intersection aware simplify #880

kleunen opened this issue Jul 3, 2021 · 2 comments
Assignees

Comments

@kleunen
Copy link

kleunen commented Jul 3, 2021

In case of a polygon and multi-polygon, the current implementation of simplify may generate self-intersecting polygons/multi-polygons. For the tilemaker project I have implemented a self-intersection aware simplify:

https://github.com/kleunen/boost_geometry_simplify

It makes sure that:

  • The simplified inner and outer rings do not contain self-intersection
  • The outer does not overlap the inners
  • In case one inner overlaps another inner, it is combined into a single inner using union
  • In case one polygon in a multipolygon overlaps another polygon, it is combined into a single polygon using a union

The simplification of the ring is performed using this algorithm:
https://www.jasondavies.com/simplify/

I believe this would be benificial for the boost geometry project and other projects as well.

Have a try here: https://godbolt.org/z/rhhxjenYP

@barendgehrels
Copy link
Collaborator

Sorry for my late reaction, I noticed this effort already earlier. It sounds awesome! I will have a close look later.

@kleunen
Copy link
Author

kleunen commented Jul 14, 2021

Yes, the github repository already has some performance enhancements and bugfixes. So it is best to checkout the example from the github repository.

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

No branches or pull requests

3 participants