Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/anastassiavybornova/bikenwgaps
Automated detection of gaps in bicycle networks: source code for IPDC procedure
https://github.com/anastassiavybornova/bikenwgaps
bicycle-network osm transportation-network urban-planning
Last synced: 19 days ago
JSON representation
Automated detection of gaps in bicycle networks: source code for IPDC procedure
- Host: GitHub
- URL: https://github.com/anastassiavybornova/bikenwgaps
- Owner: anastassiavybornova
- License: gpl-3.0
- Created: 2022-01-05T15:26:51.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2022-07-12T09:16:04.000Z (over 2 years ago)
- Last Synced: 2024-10-28T17:44:30.065Z (2 months ago)
- Topics: bicycle-network, osm, transportation-network, urban-planning
- Language: HTML
- Homepage:
- Size: 27.4 MB
- Stars: 10
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Citation: CITATION.cff
Awesome Lists containing this project
README
# Automated Detection of Missing Links in Bicycle Networks
This is the source code for the scientific article [Automated Detection of Missing Links in Bicycle Networks](https://doi.org/10.1111/gean.12324) by A. Vybornova, T. Cunha, A. Gühnemann and [M. Szell](http://michael.szell.net/). The code runs the IPDC procedure (Identify, Prioritize, Decluster, Classify), as presented in the article, for the use case of Copenhagen.**Publication**: [https://doi.org/10.1111/gean.12324](https://doi.org/10.1111/gean.12324)
**Preprint**: [https://arxiv.org/abs/2201.03402](https://arxiv.org/abs/2201.03402)
**Visualization (map)**: [FixBike.Net](http://fixbike.net)
**Visualization (table)**: [FixBike.Net/table](http://fixbike.net/table)
## Workflow demonstration: Copenhagen
The code presented here pre-processes Copenhagen data from OpenStreetMap (see below) and executes the all four steps of the IPDC procedure (Identify, Prioritize, Decluster, Classify). The last step (Classify) requires a manual classification of automatically identified gaps.
The code is applied to the use case of Copenhagen to demonstrate the workflow, but can be easily modified for application to any other city - see instructions in the last part of the readme.## Folder structure
The main folder/repo is `bikenwgaps`. It contains:
* Jupyter notebooks with code: `00_import`, `01_IP`, `02_DC`, `03_PLOT`
* `_compare`: subfolder with code output as generated if all 3 notebooks are run successfully
* `/analysis/`: subfolder with gap classification data for Copenhagen (to reproduce plots)
* `/data/`: subfolder with OSM data (in csv file format) as imported in `00_import`
* `/fixbikenet/`: subfolder with all html and image sources for [FixBike.Net](http://fixbike.net) and [FixBike.Net/table](http://fixbike.net/table)
* `packages.py`: list of packages imported within each notebook
* `parameters_plot.py`: list of plot parameters imported for plotting
* `requirements.txt`: required packages for setting up the code environmentAll output from the code is saved to the subfolders `./data/pickle/`, `./analysis/`, and `./results/`. Once all output is generated, the notebooks can be re-run independently from each other (in any order).
## Running binder
[![badge](https://img.shields.io/badge/run%20code-on%20binder-F5A252.svg?logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFkAAABZCAMAAABi1XidAAAB8lBMVEX///9XmsrmZYH1olJXmsr1olJXmsrmZYH1olJXmsr1olJXmsrmZYH1olL1olJXmsr1olJXmsrmZYH1olL1olJXmsrmZYH1olJXmsr1olL1olJXmsrmZYH1olL1olJXmsrmZYH1olL1olL0nFf1olJXmsrmZYH1olJXmsq8dZb1olJXmsrmZYH1olJXmspXmspXmsr1olL1olJXmsrmZYH1olJXmsr1olL1olJXmsrmZYH1olL1olLeaIVXmsrmZYH1olL1olL1olJXmsrmZYH1olLna31Xmsr1olJXmsr1olJXmsrmZYH1olLqoVr1olJXmsr1olJXmsrmZYH1olL1olKkfaPobXvviGabgadXmsqThKuofKHmZ4Dobnr1olJXmsr1olJXmspXmsr1olJXmsrfZ4TuhWn1olL1olJXmsqBi7X1olJXmspZmslbmMhbmsdemsVfl8ZgmsNim8Jpk8F0m7R4m7F5nLB6jbh7jbiDirOEibOGnKaMhq+PnaCVg6qWg6qegKaff6WhnpKofKGtnomxeZy3noG6dZi+n3vCcpPDcpPGn3bLb4/Mb47UbIrVa4rYoGjdaIbeaIXhoWHmZYHobXvpcHjqdHXreHLroVrsfG/uhGnuh2bwj2Hxk17yl1vzmljzm1j0nlX1olL3AJ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PPK3QzBamxdwtTCrzyg/2Rvf2EstUjordGwa/kx9mSJLr8mLLtCW8HHGJc2R5hS219IiF6PnTusOqcMl57gm0Z8kanKMAQg0qSyuZfn7zItsbGyO9QlnxY0eCuD1XL2ys/MsrQhltE7Ug0uFOzufJFE2PxBo/YAx8XPPdDwWN0MrDRYIZF0mSMKCNHgaIVFoBbNoLJ7tEQDKxGF0kcLQimojCZopv0OkNOyWCCg9XMVAi7ARJzQdM2QUh0gmBozjc3Skg6dSBRqDGYSUOu66Zg+I2fNZs/M3/f/Grl/XnyF1Gw3VKCez0PN5IUfFLqvgUN4C0qNqYs5YhPL+aVZYDE4IpUk57oSFnJm4FyCqqOE0jhY2SMyLFoo56zyo6becOS5UVDdj7Vih0zp+tcMhwRpBeLyqtIjlJKAIZSbI8SGSF3k0pA3mR5tHuwPFoa7N7reoq2bqCsAk1HqCu5uvI1n6JuRXI+S1Mco54YmYTwcn6Aeic+kssXi8XpXC4V3t7/ADuTNKaQJdScAAAAAElFTkSuQmCC)](https://mybinder.org/v2/gh/anastassiavybornova/bikenwgaps/HEAD)## Running on your local machine
### Setting up code environment
The required python version is 3.8.8. `pip` must be installed and updated before setting up the environment. `requirements.txt` must be placed in the working directory. For issues that may arise with geopandas dependencies on windows, we refer our fellow sufferers to this [blogpost by Geoff Boeing](https://geoffboeing.com/2014/09/using-geopandas-windows/).
```
conda create --override-channels -c conda-forge -n bnwenv shapely
conda activate bnwenv
pip install -r requirements.txt
conda install -c conda-forge ipywidgets
pip install --user ipykernel
python -m ipykernel install --user --name=bnwker
```### Running the jupyter notebooks
Run jupyter notebook with bnwker (Kernel > Change Kernel > bnwker) and make it trusted (Not Trusted > Trust). Run the notebooks in the indicated order:
* `00_import`
* `01_IP`
* `02_DC`
* `03_PLOT`## Using the workflow: Application to other cities
The code can be easily modified for application to any other city. Steps to take:
* Before running `00_import` - change the input data (csv files generated from [OpenStreetMap](https://www.openstreetmap.org/))
* Run `00_import`, adjusting file names for import, and verify if largest connected component is accurately represented
* Run `01_IP`, adjusting D_min (detour factor) if needed (default: D_min = 1.5)
* Run `02_DC`, adjusting B_cutoff (benefit cutoff) if needed (default: B_cutoff = 15300) and the coordinates for map centering (default is mycity_coord = [55.6761, 12.5683] for Copenhagen)
* Manually classify the gaps
* use "./analysis/gaps_declustered_table.csv" and "./analysis/gaps_declustered_plot.html" generated for your city* column "class": enter gap class (e.g. "BR" for bridge, "ST" for street, etc.)
* if gap is not confirmed (data issue/error): leave "class" cell for that row empty
* columns "address" and "comments": optional
* save edited csv table as "./analysis/gaps_classified_table.csv" (replacing the existing file of Copenhagen data)
* table is imported in the next step (notebook 03_PLOT) for visualization of results
* Run `03_PLOT`, adjusting coordinates for map centering and (if needed) adjusting gap colours and classes