Ivann Schlosser
The folder scripts
contains all the main set of scripts to reproduce
the results of the work on cycling networks for London. Some additional
script used for analysis and post-processing are within the other
folders dedicated to the analysis. The folder reproducibility
contains
a set of functions that run the scripts in the right order to reproduce
the results. The are in a way ‘meta-scripts’ that call the scripts that
actually contain the data engineering and analysis in the right order.
Aiming to have a reproducible workflow, we provide the necessary to be able to reproduce as much as possible, given potential constraints related to data sharing and other computational limitations. After revisions, most of this work can be reproduced on an average power personal laptop.
You will need recent versions of R (> 4.0.0) and python (> 3.8) for better results.
In order to set up and run this code, you need to first download the github repository. To do so, either manually, or open a terminal and run the following command:
git clone https://github.com/ischlo/quant_cycle_walk.git
Due to it’s size, the data is stored separately and needs to be
downloaded and added to the repository. The data can be downloaded from
this
dropbox.
It contains copies of openly available data sets that were downloaded at
the time of the work. The description in the
data/
folder shows the original links from which the data can be downloaded if
it is not generated by a script.
The workflow is divided into 3 main parts, first the network set up, it uses data downloaded from OSM with the OSMNx package in python to get the network data. It will download 3 networks for the different profiles considered in this work: cycling, walking and all.
Run the following command in terminal to launch the network download process.
python3 /scripts/network/data_import.py
Or, using the provided data sets (pre downloaded, but in raw format.)
run the network_setup.R
from the reproducibility folder. It will set
up already routable networks for all the profiles considered in the
work.
The routing setup requires pre processing of the London MSOA data, we
need to find the different centroids. Run area_setup.R
from the
reproducibility folder to do that. The routing process will take the
previously produced networks, do some preprocessing on them, find the
nodes from which the routing will be done, and generate distance
matrices. It will also produce summary statistics of the networks.
The spatial interaction model part of the work originally relied on a
set of R functions to be run, but since then, a package was made that
has an increased performance and allows to run these models on smaller
machines quickly. The model outputs with both methods are the same.
These changes have been incorporated since to allow for easier
reproducibility. Run test_env.R
to do the gravity models and analysis
of this section. This will populate the directory with the outputs and
results that are shown in the paper.
For any questions, bugs, additional info, do not hesitate to contact me directly.
Here is the basic information about the R it was last run on.
R.version
## _
## platform aarch64-apple-darwin20
## arch aarch64
## os darwin20
## system aarch64, darwin20
## status
## major 4
## minor 3.0
## year 2023
## month 04
## day 21
## svn rev 84292
## language R
## version.string R version 4.3.0 (2023-04-21)
## nickname Already Tomorrow
Additionally, the user can set up the environment with the package
versions used with the renv::restore()
command, assuming
renv
is
installed.
The images illustrate the number of users by transport mode at MSOA level. This work will focus on pedestrians and cyclists.
Transport usage distribution Example of paths from one point.