Skip to content

R package to make it easier to get started with travel time analyses in bits of Britain

License

Notifications You must be signed in to change notification settings

stupidpupil/parochial

Repository files navigation

parochial

A R package to make it easier to get started with travel time analyses in bits of Britain.

Features and Anti-Features

Downloading

parochial will download:

  • OpenStreetMap data from geofabrik.de
  • Welsh and Scottish bus etc. data from Traveline (requires registration)
  • "heavy" rail data from data.atoc.org (requires registration)
  • English bus etc. and Transport for London open data from DfT BODS GOV.UK
  • Terrain elevation data from Ordnance Survey

Processing

parochial

  • processes TransXChange and CIF timetables to GTFS using {UK2GTFS}
  • crops maps, using osmium, and timetables to a particular geospatial area and period in time
  • buffers geospatial bounds where appropriate to ensure adequate coverage
  • fits public transport routes to roads and railways using pfaedle
  • merges and compress GTFS timetables using gtfstidy

Outputs

parochial can prepare:

  • OpenTripPlanner network graphs, good for planning single journeys
  • {r5r} network graphs, good for producing many-to-many multimodal public transport travel time matrices
  • OSRM network graphs, good for producing many-to-many driving travel time matrices

Misc

  • Includes a GitHub Actions workflow with extensive parallelisation
  • Supports caching of downloads and outputs, both when run as a GitHub Action and when run locally
  • Writes metadata alongside outputs, including licensing and coverage info

Requirements

Minimum

  • R
  • osmium
  • Support for symlinks (e.g. macOS, Linux including Windows Subsystem for Linux)

Optional

How-to

devtools::install_github("stupidpupil/parochial")
library(parochial)

# Complete config.yml
check_config_and_environment()

download_atoc()
prepare_atoc_gtfs()
download_tnds()
prepare_tnds_gtfs()
download_and_prepare_bods_gtfs()
download_and_prepare_osm()

# If you want to include elevation data (e.g. for walking, cycling)
download_terrain50()
prepare_terrain50()

# If you've got gtfstidy and pfaedle installed
if(gtfstidy_is_available() & pfaedle_is_available()){
  prepare_merged_gtfs()
}

# OpenTripPlanner
# (Requires JDK 17)
download_otp()
prepare_street_graph()
prepare_transport_graph()
# output/opentripplanner/ should now contain graph.obj

# r5r
# (Requires JDK 11)
prepare_r5r_network_dat()
# output/r5r/ should now contain network.dat

# OSRM
if(osrm_is_available()){
  prepare_osrm_graph()
}
# output/osrm/ should now contain OSRM graph files

Licence of outputs

Outputs include data derived from the following sources:

Data License Source
ATOC Heavy Rail Timetables CC-BY-2.0 RSP Limited (Rail Delivery Group)
DfT Bus Open Data Service (BODS) OGL-UK-3.0 Department for Transport (UK Government)
Traveline National Data Set (TNDS) OGL-UK-3.0 Traveline
OpenStreetMap data ODbL-1.0 OpenStreetMap contributors, Geofabrik.de
Terrain 50 elevation data OGL-UK-3.0 Ordnance Survey

Thanks

This project developed out of a NHS Welsh Modelling Collaborative hackathon, with the support of colleagues across NHS Wales including James Cooke of the Welsh Ambulance Service.

Important inspiration included the graphite project produced as part of a piece of work by the ONS Data Campus. Also of note is the OTP4GB project and other work by ODI Leeds.

About

R package to make it easier to get started with travel time analyses in bits of Britain

Topics

Resources

License

Stars

Watchers

Forks

Languages