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

Geometry clipping - summary issue #594

Closed
systemed opened this issue Nov 25, 2023 · 2 comments
Closed

Geometry clipping - summary issue #594

systemed opened this issue Nov 25, 2023 · 2 comments

Comments

@systemed
Copy link
Owner

systemed commented Nov 25, 2023

This is an umbrella issue to summarise current clipping issues with tilemaker.

History:

Current status:

The most obvious solution is to move to a clipping algorithm which is still fast but doesn't produce degenerate geometries. Some options:

Other possible fixes/improvements:

  • Changing boost::geometry #define feature flags in geom.h may improve results in some (but not all) cases
    • remove BOOST_GEOMETRY_INCLUDE_SELF_TURNS
    • add BOOST_GEOMETRY_NO_ROBUSTNESS
  • Identify when to drop down to boost::geometry::intersection (slower but doesn't create artefacts)
  • There's a paper on "Removal of Artifacts from Polygons Clipped Using the Sutherland-Hodgman Polygon Clipping Algorithm" (J. Michael McGrew) but I haven't been able to find the full paper, only the abstract
  • Identify test case for correct that's causing it to be so slow
  • Allow user to send a signal to interrupt correct, without aborting tile writing
  • Cancel correct after a certain length of time

Known problem locations:

  • lon 24.9829-25.0049, lat 37.7533-37.7707 (near Athens) fails at several zoom levels
@systemed
Copy link
Owner Author

systemed commented Nov 27, 2023

I have reverted #581 for now. This solves the hangs we were seeing (e.g. #592) though at the cost of some geometry breakage. The commit in correct that causes the hangs is kleunen/boost_geometry_correct@008154a.

@systemed
Copy link
Owner Author

Clipping seems to be in a good state at the moment thanks to falling back to boost::geometry::intersection and proactively filtering out small rings. I'll therefore close this but it may be a useful collection of links for the future.

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

No branches or pull requests

1 participant