I have lots of points, and a road (lines) and I would like to calculate from point A to point B (the distance must route through the roads (lines).

I found this QGIS calculate distance of point along a line , but when I'm trying to do a v.distance, I don't see it saving the distance into the DB.

I need the DB to show:

Source      Destination       Distance 
Point A     Point B          10.0011 
Point A     Point C           101.12 
point A     Point D            1212  
Point B     point c           121.0 
point B     Point D         31.0 
...         ...                ...

Any idea?



You should try Network-Analysis tool (it is in core now). Here is its description in the QGIS documentation. Here is a python-scripting tutorial for network-analysis (it is in Russian, but google-translate should help).

| improve this answer | |
  • When I ran the 2nd command from that page : "Director = QgsLineVectorLayerDirector ( MYS_roads , - 1 , '' , '' , '' , 3 )" , it gave me an error: "Traceback (most recent call last): File "<input>", line 1, in <module> NameError: name 'MYS_roads' is not defined. " Where can I get help for this? :) – user10405 Sep 23 '12 at 2:09
  • @user10405, obviously you haven't defined 'MYS_roads' variable. General help (including help from the author of this tool) you can get at this thread. You can freely ask your questions in English there. – SS_Rebelious Sep 23 '12 at 8:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.