Challenges of building a traffic simulation from OpenStreetMap
Dustin Carlino (dabreegster@gmail.com)
https://github.com/dabreegster/abstreet
October 6, 2019 (CUGOS Fall Fling)
Goal
Proposed solution
Process
This talk’s focus
Map construction in… 17 minutes?
Lane/intersection geometry
OSM ways -> roads
OSM ways -> roads
OSM metadata
“lanes” = “4”
“bicycle” = “designated”
“turn:lanes:backward” = “left|through”
Blockface polylines
“PARKING_CATEGORY” = “No Parking Allowed”
Center polyline -> parallel lane polylines
Intersection geometry
Intersection geometry
Intersection geometry
Intersection geometry
Final polygon comes from:
Edge cases:
Short roads gone wrong
Short roads gone wrong
Short roads gone VERY wrong
Short roads gone VERY wrong
Manual fix
Clipping
Clipping
Clipping
Clipping
Turns
OSM per-lane restrictions
Only apply to the “ends” of OSM ways
OSM turn restriction relations
Collapsed down to ban / only relations, ignore time/vehicle/turn type restrictions
Traffic signals
Traffic signals
Sidewalks
Sadly not using OSM sidewalks
Sidewalks
Parking blackholes
Ever been trying to park, but accidentally wind up on 520 and drive off the map?
Parking blackholes
Ever been trying to park, but accidentally wind up on 520 and drive off the map?
… Turns out the driving graph isn’t connected
Find strongly connected components, redirect “blackholed” lanes to nearest driving lane in the largest SCC, start searching for parking from there instead
wat
General tricks
Visual diffs
Misses semantic changes (different traffic signal defaults, legal turns)
Conclusion