fix(map_model): add 4-tier building snap cascade for sidewalk-sparse cities - #1179
Open
AlyZaki wants to merge 1 commit into
Open
fix(map_model): add 4-tier building snap cascade for sidewalk-sparse cities#1179AlyZaki wants to merge 1 commit into
AlyZaki wants to merge 1 commit into
Conversation
…cities make_all_buildings() calls match_points_to_lanes with |l| l.is_walkable() and a 1km radius. In cities where sidewalks and footways aren't mapped in OSM this drops every building with no walkable lane within 1km — common in cities where mapping focus has been on roads rather than pedestrian infra. Add snap_buildings_resilient() which cascades through four strategies: Tier 1: 30m nearest sidewalk/footway (same as existing, strict) Tier 2: 80m extended sidewalk search Tier 3: 150m any non-light-rail lane (road edge, no sidewalk required) Tier 4: 1km stub snap to distant road Each tier logs at INFO/WARN so the import summary shows how many buildings needed degraded snapping. Buildings only drop if all four tiers fail. Tested against Cairo urban core where sidewalk mapping coverage is <1%.
Collaborator
|
This will break invariants in the traffic sim layer (related to The |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
make_all_buildings()callsmatch_points_to_laneswith|l| l.is_walkable()and a 1km radius.In cities where sidewalks and footways aren't mapped in OSM, this drops every building with no
walkable lane within 1km. That's not a fringe case — in a lot of cities outside Western Europe and
North America, OSM mapping has focused on roads and POIs, not pedestrian infrastructure. Sidewalk
coverage can be under 1%.
The result is that entire neighborhoods lose their buildings in the snap step, which breaks
pedestrian trip generation and density analysis for the whole map.
Fix
New
snap_buildings_resilient()that cascades through four strategies:is_walkable()is_walkable()!is_light_rail()— road edge!is_light_rail()— stubBuildings only drop if all four tiers fail. The log output shows exactly how many buildings needed
each tier, so you can see at a glance what the OSM sidewalk coverage is like for a given city.
No new dependencies. The function reuses
match_points_to_lanesinternally. Tested against Cairo urban core where sidewalk mapping coverage is <1%.Developed while importing Cairo urban core OSM data for a city simulation research project at Egypt University of Informatics.