This is code modified from the scientific paper Growing urban bicycle networks by M. Szell, S. Mimar, T. Perlman, G. Ghoshal, and R. Sinatra. It adapts the code to work with Low Traffic Neighbourhoods, in order to reduce the amount of kilometers of investment required whilst still providing a connected network plan. The LTNs are sourced from this project: https://github.com/Froguin99/LTN-Detection.
The code downloads and pre-processes data from OpenStreetMap, prepares points of interest, runs simulations, measures and saves the results, creates videos and plots.
Orignal Paper: https://www.nature.com/articles/s41598-022-10783-y
Recent conferance paper: https://zenodo.org/records/15231749
Example of using demand based growth on Newcastle Upon Tyne, United Kingdom
Run from your terminal:
git clone -b main --single-branch https://github.com/Froguin99/bikenwgrowth-with-LTNs --depth 1
In your terminal, navigate to the project folder bikenwgrowth
and use conda
or mamba
or micromamba
to run:
mamba env create -f environment.yml
mamba activate growbikenet
Note for MacOS users - please use environment_mac.yml
when installing, this should work excatly the same but if you run in to any issues please let me know, as I'm not a apple user!
If the above doesn't work, you can manually create the environment from your command line (not recommended):
mamba create --override-channels -c conda-forge -n growbikenet python=3.12 osmnx=1.9.4 python-igraph watermark haversine rasterio tqdm geojson
mamba activate growbikenet
mamba install -c conda-forge ipywidgets
pip install opencv-python
pip install --user ipykernel
If you want to use the environment growbikenet
in Jupyter, run:
python -m ipykernel install --user --name=growbikenet
This allows you to run Jupyter with the kernel growbikenet
(Kernel > Change Kernel > growbikenet)
Single (or few/small) cities can be run locally by a manual, step-by-step execution of Jupyter notebooks:
- Populate
parameters/cities.csv
, see below. Leave default values to run the code on two small cities. Currently only local authority districts in the North East of the UK can be used. However, if you'd like to get further places working, raise an issue of the tracker and we can work on it! - Navigate to the
code
folder. - Run notebooks 01, 02, 03 once to download and prepare all networks and POIs.
- Run notebooks 04, 05, 06 for each parameter set (see below), set in
parameters/parameters.py
The main folder/repo is bikenwgrowth
, containing Jupyter notebooks (code/
), preprocessed data (data/
), parameters (parameters/
), result plots (plots/
), HPC server scripts and jobs (scripts/
).
Most of the generated data output (network plots, videos, results, exports, logs) makes up many GBs and is stored in the separate external folder bikenwgrowth_external
. To set up different paths, edit code/path.py
- Go to e.g. https://nominatim.openstreetmap.org/ui/search.html?q=paris%2C+france and enter the search string. If a correct polygon (or multipolygon) pops up it should be fine. If not leave the field empty and acquire a shape file, see below.
- Go to Overpass, to the city, and run:
relation["boundary"="administrative"]["name:en"="Copenhagen Municipality"]({{bbox}});(._;>;);out skel;
- Export: Download as GPX
- Use QGIS to create a polygon, with Vector > Join Multiple Lines, and Processing Toolbox > Polygonize (see Stackexchange answer 1 and Stackexchange answer 2)