-
Notifications
You must be signed in to change notification settings - Fork 97
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
Reusable OSM boundary logic #475
Comments
cc/ @ZeLonewolf |
By rights, each boundary line should have all of it's left/right areas encoded, at all admin levels, or at the very least the most important one. I've thought about how to do this in classic OpenMapTiles but the SQL approach makes this way too complicated. The issue is that the left/right check is too hard. |
I feel like the left/right check should be simpler if you assemble each region polygon from the ways along the edge, check if the winding is clockwise or conter-clockwise, then assign the region's label to each way along the edge as left or right depending on whether it was reversed or not. The current approach of creating a fake point a few meters to the left or right of the polygon seems like a brittle hack IMO. |
Very very hacky, and I envisioned the same approach but I couldn't figure out how to determine the winding in pure Imposm+SQL |
Boundary handling in planetiler-openmaptiles is a mess and too slow to generalize to adding left/right labels for states, counties, towns, etc., I'd like to improve it with some built-in functionality in planetiler so that pt-omt just has to opt-into using that instead of implementing the boundary collection manually. If you squint your eyes, you basically have a bunch of segments that are shared between region polygons and you want a flow something like this:
Alternatively you might always want to emit every state border in a particular country, so you might make a decision based on the size of the country and number of regions it's divided into...? We might want to dig into how https://github.com/nvkelso/natural-earth-vector handles this and try to match it's logic.
Originally posted by @msbarry in openmaptiles/planetiler-openmaptiles#67 (comment)
The text was updated successfully, but these errors were encountered: