Skip to content

DigitalGeographyLab/cycling-speed-annotator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Realistic cycling speeds for the Helsinki metropolitan region

This is a Python package to ‘bake in’ cycling speeds into the edges of an OpenStreetMap dump. This package does not contain input data, but relies on a CSV file with columns osm_id and speed (m/s), produced, for instance, from Strava Metro data or the Helsinki bike-share system data set.

This package is used, for instance, for calculating travel time matrices of the metropolitan area.

Installation

pip install git+https://github.com/DigitalGeographyLab/cycling-speed-annotator.git

Use

Instantiate a CyclingSpeedAnnotator(), passing a pandas.DataFrame with columns for the osm_id and the measured speed of OpenStreetMap network edges. Optionally, also specify cycling_speeds_column_names as a tuple, a base_speed to normalise using the average of the measured speeds to, or a tag_name to adjust the name of the OSM tag to which this value will be written.

>>> from cycling_speed_annotator import CyclingSpeedAnnotator
>>> cycling_speed_annotator = CyclingSpeedAnnotator(
...     pandas.DataFrame({
...         "osm_id" [123,],
...         "speed": [6.5,]
...     })
... )
>>> cycling_speed_annotator.annotate("input.osm.pbf", "output.osm.pbf")

Dependencies

This package calls osmium, which is available as a package for most Linux distributions (e.g., osmium-tool on Ubuntu and Arch).

About

A Python package to bake measured cycling driving speeds into OSM extracts

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages