The code for shortest path analysis with PyQGIS specifies start and end nodes explicitly:
pStart = QgsPoint( -1.37144, 0.543836 )
pStop = QgsPoint( -1.1027, 0.699986 )
http://www.qgis.org/pyqgis-cookbook/network-analysis.html
Does anyone know whether it's possible to replace these statements with sets of all nodes, so that it's possible to get all-paired shortest path?
Thanks
Best Answer
OK, so this is what I came up with; it might be useful for novices like me out there. I know it's not perfect at all, so any edits are welcomed!
Given: I've a road network and a point layer which has x, y and TAZ( i.e. Traffic Analysis Zone id) with indexes of 191,192 and 1, respectively.
Desired: a distance matrix for all the points. for example, I'm interested in finding the distance from points with TAZ's of 125 to 135 to all the other points.