1 of 37

od2net: designing moonshot cycling networks

Dustin Carlino

11 November 2023

State of the Map EU 2023

2 of 37

Outline

  1. Intro (10-15 mins)
    1. What are we doing and why?
    2. Demo
    3. How it works
  2. Workshop (30 mins)
    • Choose your own adventure, or follow along
  3. Wrap-up (10 mins)
    • Optionally show other tools
    • Next steps & questions

3 of 37

About me

  • A/B Street and totally open source since 2018
  • The Alan Turing Institute since Dec 2021
  • Active Travel England since spring 2023
  • Mission/principles:
    • Rapidly slash use of cars in cities
    • Promote gov transparency on transportation planning and improve community engagement
    • Build cool stuff that anyone can use

4 of 37

5 of 37

6 of 37

Team

  • Chris Conlan for edge costs
  • Hadrien Salat for the logo
  • Thanks Andy Smith and Anna Zanchetta for assisting today
  • Colleagues at Active Travel England for work on safe routes to schools

7 of 37

Credits

All slides feature images with OSM data, attribution often clipped out

Apologies if color schemes are hard to see

8 of 37

Networks for drivers and cyclists aren’t equal

9 of 37

Networks for drivers and cyclists aren’t equal

10 of 37

LTS: Level of Traffic Stress

11 of 37

How do we shift trips from driving to cycling?

  • Look for trips under 5-10km taken today by driving
  • Why don’t they cycle today?
    • Weather
    • Hills
    • Safe parking/storage
    • Culture
    • Need to carry lots of passengers or luggage
    • The roads aren’t safe

12 of 37

How do we shift trips from driving to cycling?

  • Look for trips under 5-10km taken today by driving
  • Why don’t they cycle today?
    • Weather (“no wrong weather, just wrong clothing”)
    • Hills (e-bikes)
    • Safe parking/storage
    • Culture
    • Need to carry lots of passengers or luggage (cargo bikes)
    • The roads aren’t safe (so let’s improve them)

13 of 37

How do we shift trips from driving to cycling?

  • Look for trips under 5-10km taken today by driving
  • Why don’t they cycle today?
    • Weather (“no wrong weather, just wrong clothing”)
    • Hills (e-bikes)
    • Safe parking/storage
    • Culture
    • Need to carry lots of passengers or luggage (cargo e-bikes notwithstanding)
    • The roads aren’t safe (so let’s improve them)
  • If those people did cycle, which roads would they take?
  • Which of those popular roads need improvements?

14 of 37

What is a route network?

  • One particular route request (A to B) gives a specific route, along different road segments…

15 of 37

What is a route network?

  • One particular route request (A to B) gives a specific route, along different road segments…

16 of 37

What is a route network?

  • “Sum up” many routes, seeing which roads are used the most

17 of 37

Why are route networks important?

18 of 37

Why are route networks important?

  • Propensity to Cycle Tool (https://pct.bike)
    • Robin Lovelace, Rachel Aldred, James Woodcock, et al
    • Incredible impact on cycle planning in England – an official Department for Transport tool, used by all strategic cycling network plans
  • Problems with the PCT (and followups CRUSE and NPT)
    • Over a day to calculate for a country
    • Dependent on external routing service
    • Specialized for one place, hence 3 projects

19 of 37

Why not use something existing?

  • Valhalla, OSRM, BRouter, OTP, R5, GraphHopper, etc
  • Even batch modes have performance problems
  • Maybe could in the future
  • od2net isn’t a user-facing router

20 of 37

od2net demo

(Be gentle, it’s only alpha)

Two very different interpretations

  • Plug gaps in existing quiet streets?
  • Or assume any existing road can be improved?
    • Tends to be motorways or big arterial roads – because those usually designed for directness

21 of 37

od2net goals

  • Reproduce results from PCT/NPT/etc much more scalably
    • 25 minutes to route for ~13 million England-wide home-to-work trips
    • (About 90 minutes end-to-end including downloading input datasets and creating output PMTiles for viewing)
  • Lower the barrier of entry to create route networks anywhere
    • Start with your browser in a few minutes, no installs
    • Python examples for input data prep
    • Run country-wide examples on your own laptop in a few hours
  • Experiment with edge cost functions / routing profiles

22 of 37

Initial performance

23 of 37

How to use od2net

  • Directly in your browser
    • Upload your own osm.pbf or extract from Overpass (small areas)
    • Simple origin/destination pattern
    • od2net.org/interactive.html
    • od2net.org/edge_cost.html
  • On your computer (compile it or Docker)
    • Use Python example scripts to prepare real OD data for different areas
    • Run od2net, then view the PMTiles output in od2net.org
    • Add your own area!

24 of 37

How to use od2net

  • You specify:
    • The study area
    • Origin/destination data
      • Zone to zone
      • Zone to point
      • Preprocessed LineStrings from somewhere else
      • Match nearest destination for every origin
    • Level of Traffic Stress definition
    • Edge cost function
    • Uptake model
  • You get:
    • A route network, expressed as GeoJSON, PMTiles, and CSV
    • A web app to explore output

25 of 37

How od2net works

OD data

config.json

osm.pbf

od2net import

network.bin

ch.bin

od2net route

output.geojson

tippecanoe

rnet.pmtiles

Svelte + MapLibre app

26 of 37

Part 2: Workshop

Go to docs.od2net.org (or slides.od2net.org)

Option A: use interactive “many to one” mode, tune routing parameters

  • No installs, no coding

Option B: prepare input for your own city, following the Python examples

  • Rust or Docker, tippecanoe, osmium, basic Python (or R or something else)

Option C: customize LTS or edge cost functions

  • Edit the existing Rust / JS code, or write new in Python / anything else

27 of 37

Option C: customize LTS or edge cost functions

28 of 37

Edge cost deep dive

  • Routing 101: minimize total “cost” (distance)
  • Multiply distance by possible penalties
    • LTS / safety from motor vehicle traffic
    • Other safety issues (canal tow-paths, unlit parks at night)
    • Noise (separate cycleway next to a motorway)
    • Cyclist speed: hilliness, surface
    • Greenery / scenicness
    • Proximity to shops (diversity of land uses?)
    • Directness / wayfinding
    • Delays at traffic signals

29 of 37

It’s down to preference

  • “The regular commuter with an e-bike”
    • Balance time and safety, but also be near bakeries on the way to work
  • “Training athlete”
    • Dislikes delays at traffic signals and too many turns
    • Prefers steep uphills
    • Doesn’t mind safety issues
  • “Going to school”
    • Safety and noise most important, but also greenery and shops

30 of 37

Step one: balance trade-offs

Penalty = LTS * [0, 1] + Amenities * [0, 1] + Greenspace * [0, 1]

0 is good, 1 is bad

Cost = Distance * Penalty

LTS + Amenities + Greenspace = 1.0

So max Penalty is 1

(Problems with penalty = 0…)

31 of 37

Step two: map each factor into [0, 1]

  • 0 is good, 1 is bad

LTS

Amenities

0 if edge has >= threshold amenities nearby, 1 otherwise

Greenspace

TODO, but… separate [0, 1] sliders for “through greenspace, parallel to greenspace, nothing nearby”

32 of 37

Uptake model

  • Someone isn’t likely to cycle for 20 miles to work, even if the infrastructure is perfectly safe
  • So instead of counting 1 for each trip, apply a probability function based on distance
    • From PCT, “Go Dutch” assumptions
  • Other possible inputs to the uptake model (route-level, not edge-level)
    • Is it raining?
    • Total hilliness (unless e-bikes)
    • Safety along the route (how much unsafe stretch is there)
    • Is the whole route enjoyable, aesthetic, direct, etc?

33 of 37

Part 3: wrap-up

34 of 37

When can I use od2net?

  • Now, but it’s alpha
  • There will be breaking changes to config.json, the output files, etc
    • File a GH issue or make sure I know about your case, and I’ll help migrate
  • Help wanted, especially with:
    • Elevation (something with lightweight dependencies)
    • Improving LTS and edge cost functions, especially walking profiles
    • More input OD data, often from census

35 of 37

od2net limitations

  • Turn/crossing penalties
  • Elevation
  • No focus on walking yet
  • Web app is rough
  • One-way / directions
  • More edge cost factors (noise pollution, surface)
  • Tippecanoe is slow and output excludes the wrong roads

36 of 37

(Optional) Complementary tools

37 of 37

Thanks!