A Python script for QGIS that generates a cycling quality index from OpenStreetMap data for every way segment. The type of way, width and surface attributes, characteristics of parallel roads and a few other attributes are processed and an index value from 0 to 100 is calculated, which indicates the suitability of a way/road segment for cycle traffic. Also a variant of the four-stage "Levels of Traffic Stress" are calculated.
- Distinction of 16 way types, depending on OSM tagging (e.g. cycle tracks and different types of lanes, sidepath or non-sidepath cycle path, shared or segregated path, shared footways/roads/traffic or bus lanes, bicycle roads, crossings, links...)
- Basic geometric sidepath detection, if not tagged explicitly
- Evaluation of width attributes and surface characteristics (surface and smoothness)
- Evaluation of the road classification and maximum speed (for shared roads and side paths)
- Evaluation of separation and buffer characteristics
- Evaluation of other attributes such as lighting, adjacent parking lanes or surface colour
- Calculation of index values and factors for the mentioned property groups and derivation of a total index (0..100)
- Calculation of Levels of Traffic Stress (1..4), a common methodology for assessing cycling infrastructure and the cycle-friendliness of roads and paths
- Run Overpass-Query for the desired area/region to get OpenStreetMap road and way data suitable for cycling.
- Export result as GeoJSON to 'data/way_import.geojson' (or save different input files with an appended number starting at 1 to evaluate larger or different areas (e.g. 'way_import1.geojson', 'way_import2.geojson'...); set the variable 'multi_input = True' in this case). For larger areas, a more elegant variant, but with using extra tools, is to export the osm data in xml format and convert it to geojson (see example).
- Run the python script 'cycling_quality_index.py' in QGIS:
- "Plugins" => "Python Console"
- (If internal Python Editor Panel is hidden: Right click in Console => "Show Editor")
- Open File in QGIS Python Editor
- Run from there (Note: Do not use the "Browser" => File => "Run Script")
The index is a proof of concept of what is possible with OSM data. It is intended as a basis for discussion rather than a finished project. To be able to process the index for larger areas in the future, we are planning a better technical implementation (in particular processing via PostgreSQL instead of a Python script – currently it's based on "hobby" Python knowledge).
- An interactive demo map for Berlin can be found here: OpenStreetMap Verkehrswende / Cycling Quality Index
- The index was presented at the FOSSGIS Conference 2024. A video recording and the slides can be found on our project page