Routing S-Pedelec-Data

Hey Guys!

Im new to QGIS and the ORS and would love to get some help :slight_smile:

As part of my master’s thesis, I am working on the evaluation of GPS data from S-Pedelec users in Germany. So far, I have created a dataset that includes the recorded data of each user (6 weeks of usage time per User over 6 Month) on separate spreadsheets, along with point coordinates and timestamps. Using a script, I assigned Trip IDs (a 15-minute time difference between two timestamps = new ID). With another script, im gonna import the individual spreadsheets as layers into QGIS with the attributes “Timestamp”, “Latitude”, “Longitude”, “Trip_ID”. In QGIS, the points are gonna be generated for each layer based on the Lat/Long.

My initial approach was to connect the individual points of a Trip ID using the timestamps and Trip IDs to create individual routes. These are only connected by straight lines and should then be snapped to the route network using your tool. This way, further parameters such as average speeds, elevation gains, and route lengths could hopefully be calculated. If its possible, I would also like to match the destination of a route with the existing infrastructure to potentially deduce the purposes of the trips, perhaps in combination with the duration of stay, but I am still figuring that part out.

A kind employee of your team already advised me to possibly first snap the points to the network using your snapping tool and then suggested that I open a topic here :slight_smile: That was quite a bit of text, but I hope I was able to outline my problem and would be very grateful for your help!

Thank you very much,
Thorsten

And i got that error while trying to route one Layer with the Attributs “trip_id”, “latitude”, “longitude” and “timestamp” with the 1 direction option and sort by “trip_id”:
2024-07-25T19:21:08 CRITICAL Feature ID None caused a ApiError: 400 ({“error”:{“code”:2004,“message”:“Request parameters exceed the server configuration limits. The specified number of waypoints must not be greater than 70.”},“info”:{“engine”:{“build_date”:“2024-07-17T08:47:22Z”,“version”:“8.1.1”},“timestamp”:1721928068134}})
2024-07-25T19:21:08 INFO Feature ID None caused a ApiError:
400 ({“error”:{“code”:2004,“message”:“Request parameters exceed the server configuration limits. The specified number of waypoints must not be greater than 70.”},“info”:{“engine”:{“build_date”:“2024-07-17T08:47:22Z”,“version”:“8.1.1”},“timestamp”:1721928068134}})
And i already got the collaborative plan! (thanks for upgrading me)
Hope anyone could help me out :slight_smile:

Hey,

the problem here is, that you are passing more than 70 waypoints to the API, which is not allowed.

This often happens if you try to re-calculate a route by passing the points of an existing route.

These are way more than is needed for routing, since the existing route will consist of a lot of points since it needs to follow the road geometry.
For recreating a route, you’d only need a start- and endpoint on a road, possibly one or two waypoints in between in special cases.

Best regards

Hey @jschnell,

thanks for reaching out to me! I figured it out, setting up a python code and a docker so i can route more then 70 waypoints. But indeed i got the problem that on many routes cause of the inaccuracy of gps points my routes sometimes gets some “outliers” i guess cause of the inaccuracy my point gets snapped to a different route edge… but i thought just routing start and end point in terms of cycling routes may be not enough to recreate the whole, idealy the exact route taken… But considering the tracking interval of 60 to 90s per gps point its better to maybe just route start and end? or is there a way to define that it takes like only some of the points in between start/end of my trip_id marked route?

Hey,

great that you got it working with your own openrouteservice instance!

Yes, just using start and end point will not recreate the whole route and most certainly not follow the route that has been taken.
It will yield the “best” route from start to end point, though.

There is no way to define in openrouteservice to only take some points in between, that is logic that you will have to implement yourself.

Best regards