Giter Club home page Giter Club logo

bikenwgaps's Introduction

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 by A. Vybornova, T. Cunha, A. Gühnemann and M. Szell. 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

Preprint: https://arxiv.org/abs/2201.03402

Visualization (map): FixBike.Net

Visualization (table): 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 and 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 environment

All 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

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.

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

bikenwgaps's People

Contributors

anastassiavybornova avatar mszell avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

bikenwgaps's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.