bikenwgrowth

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

https://github.com/mszell/bikenwgrowth

Science Score: 54.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
    Links to: nature.com, zenodo.org
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (13.3%) to scientific vocabulary

Keywords

bicycle-network cycling gis network-analysis openstreetmap osmnx transportation-network urban-data-science urban-planning
Last synced: 7 months ago · JSON representation ·

Repository

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

Basic Info
  • Host: GitHub
  • Owner: mszell
  • License: agpl-3.0
  • Language: Jupyter Notebook
  • Default Branch: main
  • Homepage: https://GrowBike.Net
  • Size: 11 GB
Statistics
  • Stars: 73
  • Watchers: 4
  • Forks: 13
  • Open Issues: 12
  • Releases: 2
Topics
bicycle-network cycling gis network-analysis openstreetmap osmnx transportation-network urban-data-science urban-planning
Created over 5 years ago · Last pushed over 1 year ago
Metadata Files
Readme License Citation

README.md

Growing Urban Bicycle Networks

This is the source code for the scientific paper Growing urban bicycle networks by M. Szell, S. Mimar, T. Perlman, G. Ghoshal, and R. Sinatra. The code downloads and pre-processes data from OpenStreetMap, prepares points of interest, runs simulations, measures and saves the results, creates videos and plots.

Paper: https://www.nature.com/articles/s41598-022-10783-y
Data repository: zenodo.5083049
Visualization: GrowBike.Net
Videos & Plots: https://growbike.net/download

Video output from running the code on Paris, showing the growth of a bicycle network on a grid of seed points Video output from running the code on Paris, showing the growth of a bicycle network on a grid of seed points

Instructions

1. Git clone the project without the full history

Run from your terminal:

git clone -b main --single-branch https://github.com/mszell/bikenwgrowth --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

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:

bash python -m ipykernel install --user --name=growbikenet

This allows you to run Jupyter with the kernel growbikenet (Kernel > Change Kernel > growbikenet)

3a. 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.
  2. Navigate to the code folder.
  3. Run notebooks 01 and 02 once to download and prepare all networks and POIs.
  4. Run notebooks 03, 04, 05 for each parameter set (see below), set in parameters/parameters.py
  5. Optional: Run 06 to create videos.
  6. Optional: Further notebooks named with X_ can be run if needed to generate extra results or data.

3b. Run the code on an HPC cluster with SLURM

For multiple, esp. large, cities, running the code on a high performance computing cluster is strongly suggested as the tasks are easy to paralellize. The shell scripts are written for SLURM.

  1. Populate parameters/cities.csv, see below.
  2. Run 01 and 02 once locally to download and prepare all networks and POIs (The alternative is server-side sbatch scripts/download.job, but OSMNX throws too many connection issues, so manual supervision is needed)
  3. Upload code/*.py, parameters/*, scripts/*
  4. Run: ./mastersbatch_analysis.sh
  5. Run, if needed: ./mastersbatch_export.sh
  6. After all is finished, run: ./cleanup.sh
  7. Recommended, run: ./fixresults.sh (to clean up results in case of amended data from repeated runs)

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

Parameter sets

  1. prune_measure = "betweenness", poi_source = "railwaystation"
  2. prune_measure = "betweenness", poi_source = "grid"
  3. prune_measure = "closeness", poi_source = "railwaystation"
  4. prune_measure = "closeness", poi_source = "grid"
  5. prune_measure = "random", poi_source = "railwaystation"
  6. prune_measure = "random", poi_source = "grid"

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)

Owner

  • Name: Michael Szell
  • Login: mszell
  • Kind: user
  • Location: Copenhagen
  • Company: IT University of Copenhagen

Urban data science 🕸️ Sustainable mobility networks 🚲 Data viz 🌌 Created: GrowBike.Net · @nerdsitu · whatthestreet.com · Pardus.at

Citation (CITATION.cff)

cff-version: 1.0.0
message: "If you use this source code, please cite it as below."
authors:
- family-names: "Szell"
  given-names: "Michael"
  orcid: "https://orcid.org/0000-0003-3022-2483"
- family-names: "Mimar"
  given-names: "Sayat"
- family-names: "Perlman"
  given-names: "Tyler"
- family-names: "Ghoshal"
  given-names: "Gourab"
- family-names: "Sinatra"
  given-names: "Roberta"
title: "Growing urban bicycle networks"
version: 1.0.0
date-released: 2021-07-08
url: "https://github.com/mszell/bikenwgrowth"
preferred-citation:
  type: article
  authors:
  - family-names: "Szell"
    given-names: "Michael"
    orcid: "https://orcid.org/0000-0003-3022-2483"
  - family-names: "Mimar"
    given-names: "Sayat"
  - family-names: "Perlman"
    given-names: "Tyler"
  - family-names: "Ghoshal"
    given-names: "Gourab"
  - family-names: "Sinatra"
    given-names: "Roberta"
  doi: "10.1038/s41598-022-10783-y"
  journal: "Scientific Reports"
  start: 1
  end: 14 
  title: "Growing urban bicycle networks"
  issue: 6765
  volume: 12
  year: 2022

GitHub Events

Total
  • Watch event: 1
  • Issue comment event: 1
  • Pull request event: 3
  • Fork event: 5
Last Year
  • Watch event: 1
  • Issue comment event: 1
  • Pull request event: 3
  • Fork event: 5

Committers

Last synced: 11 months ago

All Time
  • Total Commits: 189
  • Total Committers: 5
  • Avg Commits per committer: 37.8
  • Development Distribution Score (DDS): 0.111
Past Year
  • Commits: 26
  • Committers: 3
  • Avg Commits per committer: 8.667
  • Development Distribution Score (DDS): 0.231
Top Committers
Name Email Commits
Michael Szell m****l@g****m 168
TylerPerlman 6****n 14
anvy a****y@i****k 5
Flo Edelmann g****t@f****e 1
tocunha t****7@g****m 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 7 months ago

All Time
  • Total issues: 16
  • Total pull requests: 6
  • Average time to close issues: 8 months
  • Average time to close pull requests: 3 minutes
  • Total issue authors: 7
  • Total pull request authors: 2
  • Average comments per issue: 2.0
  • Average comments per pull request: 0.33
  • Merged pull requests: 3
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 12
  • Pull requests: 4
  • Average time to close issues: 4 days
  • Average time to close pull requests: 4 minutes
  • Issue authors: 3
  • Pull request authors: 2
  • Average comments per issue: 1.67
  • Average comments per pull request: 0.5
  • Merged pull requests: 1
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • anastassiavybornova (8)
  • mszell (5)
  • ManuelBanza (1)
  • JoaoCarabetta (1)
  • Froguin99 (1)
  • cbueth (1)
  • FloEdelmann (1)
Pull Request Authors
  • mszell (4)
  • RogerGMarch (3)
  • anastassiavybornova (1)
  • FloEdelmann (1)
Top Labels
Issue Labels
future-request (5) bug (1)
Pull Request Labels

Dependencies

requirements.txt pypi
  • Fiona ==1.8.18
  • GDAL ==3.1.4
  • Jinja2 ==2.11.2
  • Pygments ==2.6.1
  • Send2Trash ==1.5.0
  • Shapely ==1.7.0
  • affine ==2.3.0
  • appnope ==0.1.0
  • async-generator ==1.10
  • backcall ==0.1.0
  • backports.functools-lru-cache ==1.6.1
  • brotlipy ==0.7.0
  • certifi ==2020.12.5
  • click ==7.1.2
  • click-plugins ==1.1.1
  • cycler ==0.10.0
  • decorator ==4.4.2
  • defusedxml ==0.6.0
  • descartes ==1.1.0
  • geojson ==2.5.0
  • haversine ==2.2.0
  • ipykernel ==5.3.0
  • ipython ==7.14.0
  • ipython-genutils ==0.2.0
  • jedi ==0.17.0
  • jupyter-client ==6.1.3
  • jupyter-core ==4.6.3
  • munch ==2.5.0
  • opencv-python ==4.4.0.42
  • pandas ==1.0.3
  • pandocfilters ==1.4.2
  • parso ==0.7.0
  • pexpect ==4.8.0
  • pickleshare ==0.7.5
  • prompt-toolkit ==3.0.5
  • ptyprocess ==0.6.0
  • pycairo ==1.20.0
  • pyparsing ==2.4.7
  • python-dateutil ==2.8.1
  • pyzmq ==19.0.1
  • scipy ==1.4.1
  • snuggs ==1.4.7
  • testpath ==0.4.4
  • traitlets ==4.3.3
  • watermark ==2.0.2
  • wcwidth ==0.1.9
  • webencodings ==0.5.1
requirements_nonbuiltins.txt pypi
  • csv >=1.0
  • fiona >=1.8.18
  • geojson >=2.5.0
  • geopandas >=0.8.1
  • haversine >=2.3.0
  • igraph >=0.8.3
  • matplotlib >=3.3.3
  • networkx >=2.5
  • numpy >=1.19.4
  • osmnx ==0.16.2
  • pandas >=1.0.3
  • pyproj >=2.6.1.post1
  • shapely >=1.7.0
  • tqdm >=4.55.0
  • watermark >=2.0.2
code/setup.py pypi
environment.yml pypi
  • opencv-python *