systemed / tilemaker

Make OpenStreetMap vector tiles without the stack
https://tilemaker.org/
Other
1.44k stars 229 forks source link

Retry with boost::geometry::intersection if fast_clip fails #597

Closed systemed closed 9 months ago

systemed commented 9 months ago

As per #594 and #574/#580, Maplibre GL Native objects to the 0-width borders around tile margins that fast_clip can create.

This PR falls back to boost::geometry::intersection when we're in a situation where self-intersections persist. We don't use make_valid (i.e. the custom correct code) at all in this case, just plain vanilla boost::geometry::correct. I've tested it with the original problem regions of Venice and Copenhagen, and with the additional problem areas of Athens and Shetland, and it appears to work reliably.

Performance is downgraded but less than I expected:

Given that this retains most of the performance gain while reliably producing correct geometries, I'm inclined to merge this. We can look at options for other clipping algorithms in the future.

There is one remaining issue where South Uist can disappear at z5, but I think this is a simplify problem rather than a clipping problem - simplify is creating a 0-width connection between the two islands.