This library bundles code from the hiWalk and hiBike plugins. First and foremost as a trial it includes the detour factors.
Currently this library provides two main features:
- A facility to compute detour factors based on an h3 hexgrid based on ors routing.
- A settings class to store ORS settings like API-Keys
Add this library to your poetry project by using
poetry add git+ssh://git@gitlab.heigit.org:2022/climate-action/utilities/mobility-tools.git#1.0.3To get detour factors in your project you can just use the main function of the project:
get_detour_factors(aoi, paths, ors_settings, 'foot-walking')This will return a geodataframe with hexcells and a detour factor ranging from 0 to numpy.inf
that tells you the ratio between the path length to neighbouring cells in your selected profile and the distance as the crow flies.
numpy.inf indicates a missing connection.
numpy.nan implies that there were no routable edges within the cell in the openrouteservice graph.
This project is licensed under the GNU AFFERO GENERAL PUBLIC LICENSE Version 3