OpenStreetMap (OSM) has many details about streets, but the schema presents
many challenges for rendering, routing, and analyzing done at the detail of
lanes, especially in the presence of dual carriageways, separated cycletracks
and footways, and complex intersections. osm2streets
provides a simplified
street network schema, a library transforming OSM data into this representation,
and tools to render and work with the results.
- Open StreetExplorer
- Select a test area from the left, then click Reimport
- Or navigate to anywhere in the world and press Import current view (change the driving side in Settings first)
-
A schema able to represent:
- Roads leading between two intersections
- Thickened line-strings
- A list of lanes from left-to-right, with: type, direction, width
- Intersections linking roads
- Polygon areas, with each road polygon intersecting at a perpendicular angle
- Planned: turning movements and crosswalks
- Planned: bike boxes / advanced stop lines, pedestrian crossing islands, modal filters
- Roads leading between two intersections
-
Rendering to GeoJSON
- Individual lane and intersection polygons
- Lane markings: lines between lanes, schematic display of turn arrows and access restrictions
-
Transformations to simplify complex OSM situations
- Collapsing "unnecessary" intersections between 2 roads
- Merging "sausage links" and dual carriageways into a single road
- Merging "dog-leg" intersections and other short roads into one logical intersection
- "Snapping" parallel cycletracks and footways to the main road
There are other planned features:
- routing (score functions can take advantage of knowing how a cycle lane is segregated from the road)
- isochrone / walkshed calculations
- map-matching GPS trajectories to routes
- tracing the area in between roads ("walking around the block")
- robustly representing user-created edits to the street network model, even when underlying OSM data is updated
Some of these extra features may sound redundant with libraries like osmnx and existing OSM routers. osm2streets will support these features in a way that uses the lane-level detail and consolidated road representation, is compatible with user-made edits to the network, and can be deployed in a variety of environments (native, web, offline without running an external server).
- StreetExplorer: a web app to interactively import OSM and explore the osm2streets output
- A/B Street: a collection of projects to design cities
friendlier to walking, cycling, and public transit.
osm2streets
began life here. - Bus Spotting: a bus network
GTFS viewer, using
osm2streets
to snap routes to roads - MapLibre route snapper plugin: draw line-strings snapped to the road network
- osm2streets-vector-tileserver: Dynamically generate vector tiles and view with QGIS, Mapbox, etc
- safe-cycling-map is an example Mapbox use
- lane editor to edit OSM tags and see visual results
- Planned: plugins for iD and JOSM to display streets in detail and visually edit lane tagging
You can use osm2streets today with Leaflet, Mapbox, OpenLayers, or any other web map frameworks. The osm2streets Javascript API can render to GeoJSON.
There are Python bindings, complete with an example notebook.
Since the API isn't stable yet, please get in touch first.
Java bindings are also in progress, with C++ planned.
The osm2streets library itself (Rust):
- osm2streets with the schema, transformations, rendering, etc
- streets_reader to read
osm.xml
input
Bindings for other languages:
- osm2streets-js: Javascript via WebAssembly
- Planned: Java, Python, R
The StreetExplorer web app (Javascript, CSS using Leaflet):
There's many opportunities to help out:
- writing and improving transformations of street networks
- adjusting the schema to represent bike boxes, modal filters, lanes that change width, etc
- designing how to render lane detail
- integrating the library into your own OSM tool
- adding test cases for representative situations requiring simplification
Check out the issues.
- An early article just about intersection geometry
- The followup talk at FOSSGIS (March 2022)
- The State of the Map talk: slides, video (August 2022)