Summary

Getting people walking and cycling has become a priority for many local, regional and national governments in recent years. Interventions boosting physical activity represent a ‘magic bullet’, tackling obesity, air pollution and wellbeing. Active travel is a rapidly growing topic of multi-disciplinary research but has received limited attention from data science perspectives, with a recent paper on modelling cycle network growth (Orozco et al. 2020) providing a notable exception. The work will be grounded in geographic data science, building on previous studies assessing open datasets for transport applications (Ferster et al. 2020; Haklay 2010).

In the post-pandemic world, active modes will be even more important due to reduced public transport capacities, as highlighted by the Department for Transport’s £250m Active Travel Fund (ATF) and £2bn allocated to walking and cycling over the next 5 years in the UK alone.

New policies and investment programs such as the ATF have led to increased demand for local evidence to inform interventions ranging from new cycleways to improved pavement quality. This project will explore the potential of open access transport sources such as OpenStreetMap (OSM) and Ordnance Survey Open Roads (OSOR) datasets, and associated tools, for transport planning to meet active travel objectives. Specifically, the project will explore how open datasets can be used to understand, prioritise and design active travel infrastructure, such as cycleways, pavements, crossing points and traffic-calming features. The overall aim is to research and add value to open transport infrastructure data — and OpenStreetMap data in particular — for use in transport planning. The outputs will include new insights, ideas and datasets, leading to a step change in the accessibility, utility and understanding of crowd source data for evidence-based decision making.

Introduction

This repo contains code and example data to explore the utility of open data for transport planning and, specifically, open data on transport infrastructure. It was created to support a 12 month LIDA internship, the objectives of which are to:

  1. develop new methods for bulk downloading, querying and analysing OpenStreetMap data on transport infrastructure
  2. assess the quality of OSM data with reference to ‘ground truth’ datasets including data from satellite imagery and Ordnance Survey data
  3. develop a typology of transport infrastructure data and data schemas for each infrastructure type and an actionable definition of ‘active travel infrastructure’
  4. articulate ideas on how future research, datasets, software and tools could add value to open transport infrastructure data and support sustainable transport planning practice
  5. publish reproducible methods and documentation on using OSM data for transport planning with reference to the strengths and potential pitfalls of the data
  6. develop ‘OSM transport infrastructure data packs’ for every transport authority in Great Britain, with layers reflecting a typology of transport infrastructure data developed in the project
  7. develop and publish guidance on using OSM data for transport planning
  8. suggest a research agenda to enable better use of existing open datasets on transport infrastructure and envision future developments that could make transport planning more transparent, reproducible and participatory

The internship will be undertaken in two 6 month phases, with a rough plan being for objectives 1:4 to be tackled during months 1:6 and objectives 5:8 to be tackled during months 7:12. An agile approach will be taken whereby objectives can be changed during the internship to pursue promising avenues that emerge.

There are already good tools open tools for working with transport infrastructure data, including the R packages osmextract, stplanr, and sfnetworks. These, and packages written in other languages such as Julia and Python, are largely academic-led and technical projects with little uptake among practitioners. This project will explore the landscape of open transport infrastructure, describe and critique how active travel infrastructure is represented, and document how practitioners can better use open data for evidence-based, transparent and participatory active travel interventions.

Local authority planners and other stakeholders have more data than ever before on transport systems to support their work, especially in relation to travel behaviour thanks to datasets from traffic counts, travel surveys and open access tools such as the Propensity to Cycle Tool.

However, there is less accessible data on travel infrastructure, especially in relation to walking and cycling. Good practice on designing for active travel is well known (Department for Transport 2007; Parkin 2018) and increasingly recommended/enforced. Recent government publications provide clear guidance on design parameter for active travel infrastructure, with the recent ‘Cycle infrastructure design’ guidance from the Department for Transport specifying ‘desirable’ and ‘absolute’ minimum widths of cycleways of 1.5m and 2m on cycleways with low levels of cycle traffic, for example (Department for Transport 2020). However, little is known about the extent to which new infrastructure is compliant with such guidance: there is no open data on cycleway widths in most parts of the UK, leading to new approaches to assess compliance using region-specific datasets (Tait et al. 2022). Furthermore, new tools building on OSM datasets have been developed, for example to model change in transport infrastructure, prioritise road space reallocation schemes, and identify ‘low traffic neighbourhoods’ (e.g. Lovelace 2021; Lovelace et al. 2020; Lucas-Smith 2021). The internship will generate new research and publications on additional uses of open data to support sustainable transport planning objectives.

Example of transport infrastructure in R

The brief example below shows how quickly you can get started with OSM data using command-line driven open source software to ensure reproducibility and scalability, based on an example put together for ODI Manchester.

If you’re new to R, it may be worth reading up on introductory material such as the free and open source resource Reproducible Road Safety with R (Lovelace 2020) tutorial. See Section 1.5 of that tutorial to install R/RStudio and Section 3 on getting started with the powerful RStudio editor. A strength of R is the number of high quality and open access tutorials, books and videos to get started.

With R installed, you should be able to run all the code in this example and reproduce the results.

The first step is to install some packages, by entering the following commands into the R console:

pkgs = c(
  "pct",
  "stats19",
  "osmextract",
  "tmap",
  "stplanr",
  "od",
  "dplyr"
)

Install these packages as follows:

Load the packages one-by-one with library(pct) etc, or all at once as follows:

lapply(pkgs, library, character.only = TRUE)[length(pkgs)]
#> Data provided under OGL v3.0. Cite the source and link to:
#> www.nationalarchives.gov.uk/doc/open-government-licence/version/3/
#> Data (c) OpenStreetMap contributors, ODbL 1.0. https://www.openstreetmap.org/copyright.
#> Check the package website, https://docs.ropensci.org/osmextract/, for more details.
#> Warning in fun(libname, pkgname): rgeos: versions of GEOS runtime 3.10.1-CAPI-1.16.0
#> and GEOS at installation 3.9.1-CAPI-1.14.2differ
#> 
#> Attaching package: 'od'
#> The following objects are masked from 'package:stplanr':
#> 
#>     od_id_character, od_id_max_min, od_id_order, od_id_szudzik,
#>     od_oneway, od_to_odmatrix, odmatrix_to_od
#> 
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:stats':
#> 
#>     filter, lag
#> The following objects are masked from 'package:base':
#> 
#>     intersect, setdiff, setequal, union
#> [[1]]
#>  [1] "dplyr"      "od"         "stplanr"    "osmextract" "stats19"   
#>  [6] "pct"        "tmap"       "sf"         "stats"      "graphics"  
#> [11] "grDevices"  "utils"      "datasets"   "methods"    "base"

One final line of code to set-up the environment is to switch tmap into ‘view’ mode if you want to create interactive maps:

tmap_mode("view")
#> tmap mode set to interactive viewing

We will select the Worseley Building, home of LIDA, as the case study area. As a starting point, we will use a 2 km buffer around the straight line between LIDA and Leeds city centre to capture movement along this transport corridor:

lida_point = tmaptools::geocode_OSM("Worsley Building, Leeds")
leeds_point = tmaptools::geocode_OSM("leeds")
c_m_coordiantes = rbind(lida_point$coords, leeds_point$coords)
c_m_od = od::points_to_od(p = c_m_coordiantes, interzone_only = TRUE)
c_m_desire_line = od::odc_to_sf(c_m_od[-(1:2)])[1, ]
lida_buffer = stplanr::geo_buffer(c_m_desire_line, dist = 2000)
qtm(lida_buffer)
sf::st_write(lida_buffer, "lida_buffer.geojson")

Transport infrastructure data from osmextract

The following commands get transport infrastructure data. See documentation on the osmextract website for details.

osm_data_full = osmextract::oe_get(lida_buffer, extra_tags = c("maxspeed", "lanes"))
osm_data_region = osm_data_full[lida_buffer, , op = sf::st_within]
summary(factor(osm_data_region$highway))
tmap_mode("plot")
tm_shape(osm_data_region) +
  tm_lines(col = "highway")
tmap_save(.Last.value, "osm_highway_map.png")

The same approach can be used to get building polygons:

q = "select * from multipolygons where building in ('house', 'residential', 'office', 'commercial', 'detached', 'yes')"
osm_data_polygons = osmextract::oe_get(zones, query = q)
osm_data_polygons_region = osm_data_polygons[lida_buffer, , op = sf::st_within]
qtm(zones) +
  qtm(osm_data_polygons_region)
saveRDS(osm_data_polygons_region, "osm_data_polygons_region.Rds")

There is lots more we can do with this data and other open transport datasets, and this project looks set to identify and document some of the most important uses for sustainable transport planning.

Further reading

For any questions, feel free to ask in a GitHub issue track associated with any of the repositories mentioned in this guide.

References

Department for Transport. 2007. “Manual for Streets.” London: Telford. https://assets.publishing.service.gov.uk/government/uploads/system/uploads/attachment_data/file/341513/pdfmanforstreets.pdf.
———. 2020. “Cycle Infrastructure Design (LTN 1/20).” 1/20. Local Transport Note. London. https://assets.publishing.service.gov.uk/government/uploads/system/uploads/attachment_data/file/904088/cycle-infrastructure-design-ltn-1-20.pdf.
Ferster, Colin, Jaimy Fischer, Kevin Manaugh, Trisalyn Nelson, and Meghan Winters. 2020. “Using OpenStreetMap to Inventory Bicycle Infrastructure: A Comparison with Open Data from Cities.” International Journal of Sustainable Transportation 14 (1): 64–73. https://doi.org/10.1080/15568318.2018.1519746.
Haklay, Mordechai. 2010. “How Good Is Volunteered Geographical Information? A Comparative Study of OpenStreetMap and Ordnance Survey Datasets.” Environment and Planning B: Planning and Design 37 (4): 682–703. https://doi.org/10.1068/b35097.
Lovelace, Robin. 2020. “Reproducible Road Safety Research with R.” Royal Automotive Club Foundation. https://www.racfoundation.org/wp-content/uploads/Reproducible_road_safety_research_with_R_Lovelace_December_2020.pdf.
———. 2021. “Open Source Tools for Geographic Analysis in Transport Planning.” Journal of Geographical Systems, January. https://doi.org/10.1007/s10109-020-00342-2.
Lovelace, Robin, Joseph Talbot, Malcolm Morgan, and Martin Lucas-Smith. 2020. “Methods to Prioritise Pop-up Active Transport Infrastructure.” Transport Findings, July, 13421. https://doi.org/10.32866/001c.13421.
Lucas-Smith, Martin and Nuttall, Simon. 2021. “Mapping Modal Filters and LTNs.” CycleStreets Ltd. July 25, 2021. https://www.cyclestreets.org/news/2021/07/25/mapping-ltns/.
Orozco, Luis, Federico Battiston, Gerardo Iñiguez, and Michael Szell. 2020. “Data-Driven Strategies for Optimal Bicycle Network Growth.” Royal Society Open Science 7 (December): 201130. https://doi.org/10.1098/rsos.201130.
Parkin, John. 2018. Designing for Cycle Traffic: International Principles and Practice. ICE Publishing. https://www.icevirtuallibrary.com/isbn/9780727763495.
Tait, Caroline, Roger Beecham, Robin Lovelace, and Stuart Barber. 2022. “Is Cycling Infrastructure in London Safe and Equitable? Evidence from the Cycling Infrastructure Database.”