Map model from scratch

12 March 2022, FOSSGIS OSM-Samstag

Dustin Carlino

Intro

Straßenraumkarte Neukölln changed everything for me

About me

  • A/B Street since 2018
  • Alan Turing Institute since December 2021

A losing battle

https://a-b-street.github.io/docs/tech/map/geometry/index.html

Talk outline

  • Why OSM can’t represent road geometry
  • Thought experiment: a schema from scratch
  • Practical next steps
  • Discussion

Part 1: Why

https://www.openstreetmap.org/node/8909891523

In A/B Street

Does it really have to be so complicated?

The OSM schema now

  • Road center-lines as ways, flat key=value strings
  • Cyclepaths and sidewalks might be mapped separately
  • Divided one-ways / dual carriageways are split when there’s a physical median

Does this schema serve classic uses well?

  • Tagging
  • Rendering
  • Routing

Tagging / editing

  • Easy to start with, but all the complicated situations
  • When splitting into a dual-carriageway, people often forget to adjust number of lanes or sidewalk=both
  • No end to questions about sidewalks/cycleways as attributes vs a separate way
  • Edge cases like https://osmus.slack.com/archives/C2VJAJCS0/p1645748754848769

Arbitrary modeling choices

  • Can’t represent middle of road at splits/joins

Arbitrary modeling choices

  • What’s the speed limit, name, or highway classification of the tiny inner segments?

Rendering

  • At lower zooms, I think Carto tries to simplify “sausage links”?

Routing

  • Probably the best served
  • Deduplicating traffic signals for cost
  • Simplifying directions through complex junctions

“Advanced” use cases

Pedestrian crossings

  • https://www.accessmap.io, Open Sidewalks, Project Sidewalk
  • sidewalk width and curb cuts
  • sidewalk width isn’t constant
  • the shape near bus shelters, rubbish bins, other obstacles

Sidewalk width matters

CAD

Traffic simulation

  • Understand a junction as one logical object for signal timing, turning movements

Road space reallocation

Does anybody in industry care?

Appendix: Attempts to fix the current schema

Part 2: Let’s start over

Forget OSM entirely for the moment

We want a representation that…

  1. shows geometry pretty accurately
  2. lets you understand hierarchy – entire junction, just the north approaching road and its crossing islands, individual lanes, stopping line
  3. represents routing / turn restrictions
  4. represents semantics that apply over space (loading zones, no parking overnight)

Test cases

Here are some things it has to handle

Complex junctions

https://www.openstreetmap.org/node/5220776402

Bike lanes crossing a slip lane

https://www.openstreetmap.org/node/4694379084

London’s weird bike infrastructure

Contraflow cycle entrances

https://www.openstreetmap.org/node/3194001392

Crossing islands

Pocket parking

Bulb outs

https://www.sfbetterstreets.org/find-project-types/pedestrian-safety-and-traffic-calming/traffic-calming-overview/curb-extensions/

Let’s just draw stuff

Borough station

Borough station

Subdivide space

  • One road object
    • left side
      • lanes
      • grass verge
      • separate cycle track
      • pavement
    • median / crossing island
    • right side
  • Attributes (or even… a JSON object) per piece

Subdivide space

Boundaries of adjacent polygons

  • When polygons share a boundary, use linear referencing to mark an interval of it
  • Add attributes (cough JSON cough) to it
  • Curb cuts, turns
  • If it’s thick enough, subdivide into a polygon

Boundaries of adjacent polygons

Linear vs freeform movement

  • Calculate straight-skeletons?
  • Or also have the classic center lines

Questions

  • some CAD or drawing program to subdivide space, snap lines easily?
  • game engines: navmeshes?

Part 3: Practical next steps

Would this be hard to map?

  • in ID or JOSM, oh yeah
  • dedicated UI
    • first step: just draw a linestring over satellite, quickly thicken it or shift left/right
    • when width varies, creating bulges and dragging them?

Pay as you go / a migration plan

If we did come up with a new schema, we don’t need to start mapping from scratch

  1. Continue mapping the road center with lane attributes
  2. Use osm2lanes + A/B Street’s road/intersection geometry heuristics
  3. Use the dedicated UI to correct mistakes / add detail

Satellite imagery

  • Sufficient to map this kind of detail?
  • Tree cover and building shadows
  • Any easy-to-use computer vision tools for snapping lines to edges or segmenting?

What other data is sometimes available?

Seattle

Seattle

Seattle

Seattle

London

São Paulo

São Paulo

São Paulo

Landuse polygons

https://www.openstreetmap.org/relation/1277566#map=17/51.47069/-2.52027

A modest proposal

  • Estimate width
    • Start from OSM center-line
    • Project left until you hit something
    • Repeat for right
    • Shift the center-line to actually be centered

More data

Negative space

  • Nothing but buildings?
    • Group into a block
    • Take a concave hull
    • Widen road center-lines until they hit
  • Not advocating for full automation / imports
    • Human/machine collaboration, just a better tool

Appendix: other resources

Conclusion