The Propensity to Cycle Tool: Software, design and uses

Robin Lovelace, University of Leeds.

9th Dec. 2015. Slides: rpubs.com/RobinLovelace

Presentation structure

  • Software for sustainable transport
  • Propensity to Cycle Tool: design and development
  • Uses: exploring cycling in Leeds
  • Further research ideas

Software for sustainable transport

Software as tools

The wider context

I: Software

Transport planning tools: expensive…

And potentially dangerous!

The solution

  • New breed of software products

Why open source?

  • The global transition away from fossil fuels is big business
  • Many planners are scrambling to make their cities healthier and cleaner
  • But if solutions cannot be controled and shared, how can they scale?

Which companies are ready for a transition away from fossil fuels:

New software can enable more democratic decision making

Tools of the trade

  • QGIS
  • GRASS
  • R
  • Python

Program or be programmed

  • Rushkoff, D. (2010). Program or be programmed: Ten commands for a digital age. Or Books.

R's spatial ecosystem

QGIS

New software: aequilibrae

Why R?

The packages used

Can be installed and loaded in 6 lines of code:

pkgs <- c("devtools", "shiny", "rgdal", "rgeos", "ggmap") # official packages
install.packages(pkgs) 
library(devtools) # enables installation of leaflet
gh_pkgs <- c("rstudio/leaflet", "robinlovelace/stplanr") 
install_github(gh_pkgs) # install packages on github
lapply(c(pkgs, "leaflet", "stplanr"), library, character.only = T) # load all

RStudio

RStudio Desktop is highly recommended for Shiny development.

Shiny

shiny is a framework for creating online interactive data visualisation 'apps'.

  • A framework for making R output interactive
  • An 'app' development framework
  • A (small) growing community of developers centred around RStudio
  • A way to structure online tools: separation of GUI and server via server.R and ui.R files.

Alternatives

  • animate package
  • Google Charts (googleVis::) and
  • plotly
  • D3
  • Tableau

For maps

  • Leaflet (supported by Shiny)
  • Google Maps API

What's shiny good (and not so good) for?

Build's on R's existing strengths

  • Data visualisation (ggplot2)
  • Increasingline widely understood language for querying data
  • Amazing range of add-on packages

Flexibility

Not so good for

  • Scalability
  • Database interaction
  • Low-level control

What do shiny apps look like?

# type this to find out!
runExample()

More examples

Leaflet

An R interface to the Leaflet JavaScript library, compatible with Shiny.

cent <- geocode("Girona")
leaflet() %>% 
  addTiles() %>%
  addCircleMarkers(data = cent)

II: The Propensity to Cycle Tool (PCT): design

Policy context

  • House of Commons Criticising the DfT for using closed models
  • 'Impact' and 'engagement' increasingly important for research funding
  • Complex data cannot be adequately summarised in a single static graphic
  • Phase I: proof of concept (February - August 2015)
  • Phase II: nationwide deployment (November 2015 - 2018)

See: cedar.iph.cam.ac.uk/research/modelling/npct-tool

Modelling context

Interactive online tools

Design criteria

  • Interactive basemap
  • Points, lines and polygons
  • Cascading effects of different scenarios > - Tidy!

Early user testing

The underlying theory

Live demo!

Zoom-dependent selection and freeze Scope

Model output tab I: Coventry

Model output tab II: Manchester

III: Uses of the PCT

What kind of questions can it help answer?

  • Where should we build for existing cyclists?
  • New cyclists in the medium term?
  • Long-term strategy?
  • Try it for a city!

Example: Trinity Way, Manchester

Other planned features

Beta

  • Network analysis (various options)
  • Hilliness allocated to cycle network Version 1 - nationwide (June 2016)
  • HEAT outputs
  • Incorporation of user feedback
  • Travel to school layer (data pending)

Version 2 - nationwide (June 2017)

  • Micro-level analysis
  • Socio-demographic variables (new scenarios?)

IV Future research ideas

Future development (near term)

Potential futures: e.g. community contributed

  • Custom scenarios (e.g. 20% cycling by 2020 in Bristol)
  • Custom scenarios (e.g. 10% cycling by 2020 in Manchester!)
  • Scenarios estimating impacts from specific interventions
  • International comparisons of propensity to cycle
  • A global propensity to cycle map?

How could transport infrastructure change if people worked from home?

How best to reallocate space away from cars?

How transport engineers can encourage car sharing?

Fork my code!

  • The work is open source so can used as a foundation for further work by others
  • E.g. councils with the technical know-how
  • E.g. cycle campaigner 'hackers'

Links and references