What I want to do is calculate travel times between points within a road network. I know there are options with GRASS (via v.net
) and pgRouting (and possibly many more). I intent to stick to the standard QGIS network analysis though.
I studied all the necessary material in the Network Analysis Library (pyQGIS cookbook) and I am able to obtain the distance in metres for any two points in my network via the standard QgsDistanceArcProperter()
and dijkstra's algorithm. What I am not capable of doing is creating a properter that uses a different cost, namely the travel time per segment using the information on speed from its attributes.
Using python QGis network analysis library to calculate short path based on speed and distance? did a good job in translating the speedproperter that is used in the RoadGraph plugin. I am not able to get neither of their properters to run though. QGIS is crashing, so far I couldn't figure out why.
Does anyone know of another already existing properter somewhere that works? Or can point me to something that might bring me one step farther?
EDIT:
It seems that with QGIS3.0 the whole network analysis is revised. Some methods get renamed (e.g. properter -> strategy).
The method is going to be QgsNetworkSpeedStrategy()
.
The constructor is explained here, can anyone help to translate that into a python class that I could implement within my QGIS 2.18 python script?