vendredi 30 mai 2014

Does not show shortest path - networkx QGIS


Vote count:

0




I used the following commands (in qgis console) to get the shortest path with astar algorithm. But the result shows just '[]' every time. Why was that? Please help me to find a solution to this problem.



>>> import networkx as nx
>>> G = nx.read_shp(str(iface.mapCanvas().currentLayer().source()))
>>> route = nx.shortest_path(G, G.nodes()[1], G.nodes()[10])
[]
>>> route = nx.shortest_path(G, G.nodes()[20], G.nodes()[30])
[]


asked 2 mins ago

Dil

6





Aucun commentaire:

Enregistrer un commentaire