osm2streets

Generating OpenStreetMap street networks with better geometry

Dustin Carlino, Ben Ritter, Michael Droogleever

7 July 2022, ASG Birmingham

Talk outline

  • OpenStreetMap primer
  • Problems
  • Possible solutions
  • Next steps and API design

OpenStreetMap primer

https://www.openstreetmap.org/#map=18/52.45115/-1.93205

OSM primer

OSM representation of streets

  • Node: Points with key/value strings
  • Way: Line-string with key/value strings

OSM representation of streets

  • The way’s attributes describe the lanes, direction, speed limit, access restrictions…
  • The way has to be split when any of these change

Footpaths and cycle paths: as attribute

Footpaths and cycle paths: as attribute

From CycleStreets SoTM talk

  • People don’t like tagging this way

Footpaths and cycle paths: as separate ways

  • Also for dual carriageways

Problems with this representation

Rendering

  • Ideally we can do this
  • Note intersection polygons are guessed from road width

Rendering

  • Different OSM roads overlap each other

Rendering

Rendering

Rendering

Rendering

How is road space allocated today?

Editing a road by lanes

A/B Street (top) & Streetmix (bottom)

  • For civic engagement, or just to correct OSM data more easily

Statistics per road

  • Cycling Infrastructure Prioritisation Toolkit says Blackfriars need a cycle lane…
  • Spatial inequality of streets without sidewalks
  • How many collisions along a divided highway?

Routing instructions

  • Every SatNav ever: “Use the right lane to bear slightly left, then take a sharp right”
  • A human: “Turn right at the intersection”
  • Cost function for how many traffic signals crossed

Blockfinding

  • Traces the inside of a “city block”, exactly following road outlines

Blockfinding

Traffic simulation

  • Rules about not blocking junctions

Traffic signal timing

  • Editing UI and automatic heuristics

Possible solutions

osm2streets

https://github.com/a-b-street/osm2streets

osm2streets

  • A directed graph with geometry
  • Start from OSM, then apply transformations to it
    • Collapse degenerate intersections when nothing important differs
    • Find and merge short roads
    • Shrink parallel overlapping roads (stop-gap)
    • Snap parallel cycleways to road (broken)

osm2streets

osm2streets

osm2streets: example transformation

  • Both geometry and graph properties used
    • Remove edge
    • Remove one of the nodes (arbitrarily)
    • Connect edges to the surviving node
    • Use points from original polygons to form the final
    • Preserve turn restrictions?

osm2streets: example transformation

  • road we’re deleting has simple restrictions
  • road we’re deleting has complicated restrictions
  • road we’re deleting is the target of a simple BanTurns restriction
  • road we’re deleting is the target of a simple OnlyAllowTurns restriction
  • road we’re deleting is the target of a complicated restriction
  • road we’re deleting is the ‘via’ of a complicated restriction
  • road we’re deleting has turn lanes that wind up orphaning something

osm2streets: dual carriageways

  • Slight generalization of sausage links

osm2streets: dual carriageways

  • Preserve graph structure
    • Median/verge lane in the middle
    • Turn restrictions for the junction

osmstreets: merging parallel ways isn’t easy

Cycle lanes crossing slip lanes

osmstreets: merging parallel ways isn’t easy

  • Cyclepath is sometimes part of the road, sometimes legitimately a separate path
  • New splits?

momepy’s GSoC

Find width between buildings/areas

Find width between buildings/areas

Find width between buildings/areas

  • Estimate road width
    • Start from OSM center-line
    • Project left until you hit something
    • Repeat for right
    • Shift the center-line to actually be centered
    • Also look for parallel OSM ways
  • Urban areas only
  • Likely to need lots of human intervention; tool-assisted OSM tagging?

Tag areas in OSM?

Tag areas in OSM?

Tag areas in OSM?

Tag areas in OSM?

Tag areas in OSM?

  • It’s additive to the schema; no existing software breaks
  • This could be done, and probably the OSM community would do it.
  • You can’t tag what you can’t see
  • “Just” need a web viewer and editor

An idea for turn lanes and pocket parking

  • Courtesy Ben
  • One OSM way for the “entire street”, block to block
  • An overlapping way showing where the turn lane appears
    • Another where it exists with full width
  • Equivalent to linear referencing
  • Technically doable in OSM schema, but…
    • Editor UI for overlapping ways
    • Making all common renderers, editors, etc understand this

An idea for turn lanes and pocket parking

Next steps and API design

Desired output

  • Data + library/API calls
    • Usable from web / Javascript, native (Python or other)
    • Like osmnx, work with OSM street networks at a higher level
    • Also related: CityGML

Desired output

  • Desiderata
    • Detailed rendering – including markings
    • Routing and isochrones
    • Semantic description of lanes along roads
    • Blockfinding
    • Editing

Desired output

  • What would you like to do with OSM street networks that you can’t?

Small next steps

  • Streetmix-style lane editor for OSM
    • “How do I tag a contraflow shared bus/bike lane?”
    • Bonus: Split roads when the lanes differ
  • The A/B Street-style renderer, but as a web map
    • “You can’t tag what you can’t see”
    • Either figure out how to generate tiles worldwide
    • or dynamically render with Overpass as the data source

Thanks!