Skip to content

Froguin99/bikenwgrowth-with-LTNs

 
 

Repository files navigation

Growing Urban Bicycle Networks - with an LTN twist

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 Example of using demand based growth on Newcastle Upon Tyne, United Kingdom

Instructions

1. Git clone the project without the full history

Run from your terminal:

git clone -b main --single-branch https://github.com/Froguin99/bikenwgrowth-with-LTNs --depth 1

2. Install the conda environment growbikenet

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!

Environment creation from command line

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

Set up Jupyter kernel

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)

3. Run the code locally

Single (or few/small) cities can be run locally by a manual, step-by-step execution of Jupyter notebooks:

  1. 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!
  2. Navigate to the code folder.
  3. Run notebooks 01, 02, 03 once to download and prepare all networks and POIs.
  4. Run notebooks 04, 05, 06 for each parameter set (see below), set in parameters/parameters.py

Folder structure and output

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

Populating cities.csv

Checking nominatimstring

Acquiring shape file

  • 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)

About

Source code for the paper "Growing urban bicycle networks", exploring algorithmically the limitations of urban bicycle network growth

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Jupyter Notebook 99.6%
  • Other 0.4%