How are the costs returned by pyQGIS implementation of Dijkstra (QgsGraphAnalyzer.dijkstra) calculated?
As far as I know, these costs correspond to the distance from the starting node to each of the other nodes in the graph, however the cost values I get are way too large to be the distances on the underlying road network.
For example: For a CRS EPSG:4326, the length of an edge in my road network, as returned by feature.geometry().length()
is 36.769 metres, where feature.geometry().asPolyline() = [(10573, 5837), (10547, 5863)].
On the other hand, the following is the cost array returned by Dijkstra:
(tree, cost) = QgsGraphAnalyzer.dijkstra(graph, graph.findVertex((10547, 5863)), 0)
cost[graph.findVertex(QgsPoint(10573, 5837))] = 17176150.0812.
Again, from my understanding the cost value above should be 36.769 rather than 17176150.0812.
How can the above be explained?