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.
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:
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.
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:
install.packages(pkgs)
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")
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.
For any questions, feel free to ask in a GitHub issue track associated with any of the repositories mentioned in this guide.