Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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?

Thanks!

share|improve this question

1 Answer 1

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

share|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

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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