This is a Python package to ‘bake in’ car speeds into the edges of an OpenStreetMap dump, according to data looked up from a floating car data set, using the methods described in Perola (2023). The data contained in this package covers the Helsinki metropolitan area.
This package is used, for instance, for calculating travel time matrices of the metropolitan area.
pip install git+https://github.com/DigitalGeographyLab/car-speed-annotator.git
Instantiate a CarSpeedAnnotator()
using one of rush-hour
, midday
or nighttime
to account for the different driving speeds at different congestion levels. Then, call its annotate()
method with an input and an output file (both either pathlib.Path
s or str
).
>>> from car_speed_annotator import CarSpeedAnnotator
>>> car_speed_annotator = CarSpeedAnnotator("rush-hour")
>>> car_speed_annotator.annotate("input.osm.pbf", "output.osm.pbf")
This package calls osmium
, which is available as a package for most Linux distributions (e.g., osmium-tool
on Ubuntu and Arch).