My “big goal” is to figure how far cyclists are willing to go to use cycling paths instead of roads.
My plan is as follow. It lacks nuance, but it’s a first step and I just want to learn how to use graphhopper.
1- take bike gps data, map-match it using graphhopper and get the length of the trip and how much of it was spent on cycling paths vs roads
2- take the same bike gps data, get directions from the first point to the last point and get the length of the shortest trip.
If “2” is 10 kilometers of roads and “1” is 5 kilometers of roads and 10 kilometers of cycling paths, then the cyclist was willing to ride 10 kilometers of cycling paths to save 5 kilometers of road.
What I have done so far:
- I have downloaded 4881 bike trips (https://www.donneesquebec.ca/recherche/fr/dataset/vmtl-trajets-individuels-velo-enregistre-mon-resovelo) and the corresponding OSM road network (download.geofabrik.de/north-america/canada/quebec-latest.osm.pbf)
- I have map-matched 4858 (99.5%) of them using “recent_core” branch and importing using the --vehicle=“bike” switch. The map matched trips are a bunch of points in GPX format.
I am not sure how to do the next step, namely converting the map-matched GPX to a list of road segments travelled.
Is this feature offered by graphhopper map-matching?
edit: this was discussed here, I dont see a solution though : Include timestamps and OSM ids when generating .res.gpx