BikewaySim
No description available
Install / Use
/learn @gti-gatech/BikewaySimREADME
BikewaySim
BikewaySim is a collection of open-source scripts and notebooks for helping cities, DOTs, MPOs, and/or advocacy groups assess the connectivity/bikeability impacts of new cycling facilities (bike lanes and cycletracks) through change in cycling impedance.
Cycling impedance measures the relative difficulty of cycling from point A to point B considering travel time, elevation/hills, exposure to automobile traffic, the presence of bicycle facilities, and other preferences that cyclists have for road attributes.
BikewaySim's cycling impedance model is trained on recorded cycling trips. The cycling impedance model can then be used to find the least cycling impedance route (Figure 1) between any two places (home to grocery, school to park, etc.). On its own, this model can be used by cities to help citizens find better cycling routes and encourage cycling.
<figure> <img src="resources\impedance_example.jpeg" width=350> <figcaption><b>Figure 1:</b> Example of BikewaySim impedance routing (purple) and travel time only routing (black)</figcaption> </figure>When paired with BikewaySim's bicycle facility assessment framework (Figure 2), the cycling impedance model can be used to evaluate proposed cycling facilities using five metrics/visuals using the change in simulated impedance from the bicycle facilities. Cities, DOTs, MPOs, and/or advocacy groups can use the outputs of the framework to prioritize new cycling facilities accordingly.
<figure> <img src="resources\framework_workflow.jpeg" width=350> <figcaption><b>Figure 2:</b> BikewaySim bicycle facility assessment framework</figcaption> </figure> <!-- Add descriptions for each metric --> <!-- | Metric | Description | Example |-|-|-| | Trip Impedance Reduction | Impedance reduction shows TAZs that | <img src="resources/origin weighted impedance change.jpeg" width=200> | | Percent Detour | | <img src="resources/percent detour.jpeg" width=200> | | Change in Link Betweenness Centrality | | <img src="resources/lbc future - current.jpeg" width=200> | | Improvement Impedance Reduction | | <img src="resources/impedance contribution.jpeg" width=200> | | Bikesheds | | <img src="resources/bikeshed add remove.jpeg" width=200> | -->Main functionalities:
- Downloading and processing OpenStreetMap network data for bicycle routing using Geofabrik and OSMnx
- Conflating and reconciling attributes from other network sources to OSM
- Map matching cycling GPS traces to OSM using Leuven Map Matching
- Calibrating link and turn impedance functions for cycling using bicycling GPS traces or count data using stochopy
- Finding the least impedance route for selected or all-to-all O-D pairs given calibrated or custom link and turn impedance functions using NetworkX and rustworkx
- Using least impedance routes to generate five metrics for assessing the impacts of planned cycling facilities
Data Requirements
BikewaySim is intended to work in the United States with minimal data as it pulls network data from OpenStreetMap and elevation data from USGS. However, it is highly recommended that you provide more detailed network attribute data and cycling GPS traces so that cycling impedances can be calibrated for your study area (as the default ones may not be applicable to your study area since they were calibrated for Atlanta, GA).
Required:
- A study area in shapefile, geojson, geodatabase, or geopackage format (bounding boxes also work)
- Cycling infrastructure improvements in shapefile, geojson, geodatabase, or geopackage format
Optional:
- Supplemental network attribute data from government, public, or private sources to be conflated to OpenStreetMap data (see Data Used for examples)
- Cycling GPS traces for calibrating cycling impedances
Installation:
- Assuming that you have conda and git installed for your machine already
- Clone the repository into your desired directory
- Create a new conda environment named
bikewaysimusing theenvironment.ymlfile (make sure that you're in the directory with the .yml file)
conda env create -f environment.yml
- Activate the 'bikewaysim' environment
conda activate bikewaysim
- Change into the
BikewaySim/srcfolder on command line and install the development packagebikewaysim
pip install -e .
- Great! The main things should be installed! If you're having troubles with creating the environment, open the
environment.ymland try installing the packages one at a time in a new environment instead. - Most of the code is executed through Jupyter Notebooks which can be opened/run/edited through VS Code or Jupyter Notebook, just make sure the
bikewaysimenvironment is activated.
Initial Setup
- Create a config.json file to define the project directory and various settings (e.g., desired projected coordinate system, supplemental data, etc.). See
example_config.jsonfor a template. - Create a new study area using GIS or bounding box or provide an existing one. Must be in
.geojson,.gpkg, or.shpformat. Place it in the root of the project directory.
Creating a Network (network module)
- Download OpenStreetMap network data using step_0_download_process_osm.ipynb
- Continue running through each
.ipynbfile in thenetworkmodule in order until step_8_export_network.ipynb
Configuring network routing settings (routing_settings module)
- Run the notebooks
Running Analysis Using Calibrated Impedances (bikewaysim_framework module)
Quick Start Bike Routing
- Use the bicycle facilities module to add in bicycle facilities from other data sources and OpenStreetMap
- Run the notebooks in the bikewaysim_framework module to route cycling trips using default or custom impedance factors
Quick Start Bike-Transit Routing
- Clone the transit-routing submodule
- Open Simulating Bike-Transit Trips.ipynb and walk through the steps until a study area is generated
- Open Downloading_OSM.ipynb and use the generated study area to download OpenStreetMap network data
- Continue with Simulating Bike-Transit Trips.ipynb
BikewaySim Facility
- Open and follow the instructions to download OpenStreetMap network data
- Open Step_1 Network_Filtering_and_Processing.ipynb to process OSM into network graph format and identify link types
- Open Step_2_Network_Reconciliation.ipynb to finalize the network for routing
- Open Run_BikewaySim.ipynb to perform aggregated shortest path routing and output Geopackage files to visualize in GIS software
List of Modules
| Module | Description | Status |
|-|-|-|
| bicycle_facilities | Add supplemental bicycle facility data | working |
| bike-transit| Run aggregated bike-transit shortest path calculations | working |
| bikewaysim_framework | Run aggregated cycling shortest path calculations and create | working |
| map_matching | Map-match GPS trace data | working |
| impedance_calibration | Use map-matched GPS traces to calibrate link impedance functions | in development |
| network | Download OSM data and process for shortest path routing | working
