-
-
Notifications
You must be signed in to change notification settings - Fork 334
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
"Flooded" map #32
Comments
Guess it's a flood simulator now. >_< Turning clipped OSM data into water polygons is a bit hard. https://github.com/dabreegster/abstreet/blob/9aa4fda837ab813fd2e6d7e4381208ee03ab55c2/convert_osm/src/osm_reader.rs#L347 is the relevant code. This roughly follows https://wiki.openstreetmap.org/wiki/Relation:multipolygon/Algorithm, then tries to deal with disconnected ends by finding a spot where the half-formed ring intersects the boundary polygon, and tracing along it. I think the problem here is that when tracing along the boundary polygon, little bits of land reappear, and the code doesn't deal with that case yet. I don't know if I'll be able to look at this soon, but if you want to try to tackle it, run with |
I happened to hit this problem in Manhattan and found a possible workaround -- flip the order at https://github.com/dabreegster/abstreet/blob/41e80b48a16c624eda533de21131f2b8fb947407/geom/src/ring.rs#L94 to get the inverse polygon. Always picking the shorter connection doesn't make sense. There might be a way to decide automatically whether to pick the shorter or longer connection. |
Stumbled across https://github.com/QwantResearch/osm_boundaries_utils_rs/blob/master/src/boundaries.rs, which could be the start to something more robust |
I had similar issues - maybe process water area data by some external software such as mapshaper and load already clipped water polygons? ( https://github.com/mbloch/mapshaper ) |
I had looked around a while ago for existing water polygons and didn't find much. I missed mapshaper; I'll see if it could be an easier option. Thanks! |
Another case that we need to handle is gluing two pieces of coastline together that're expressed in different ways. In Lisbon we have a But maybe not... I also see another section of |
From https://wiki.openstreetmap.org/wiki/Tag:natural%3Dcoastline |
I've built my own map for this region in OSM: https://www.openstreetmap.org/#map=14/5.3248/-4.0158
But the resulting map in A/B Street looks like the whole neighborhood is under water 😆
It seems only cosmetic, I couldn't see any impact on the traffic simulation.
The text was updated successfully, but these errors were encountered: