[GRASS-user] Multiple v.net.path parameters

Moritz Lennert mlennert at club.worldonline.be
Wed Jul 1 11:56:47 EDT 2009


On 01/07/09 04:44, J. Holden wrote:
> Hello,
> 
> I am looking to use v.net.path to determine the distance of many
> different points to many different other points on a network.
> 
> Is it possible to send multiple parameters to v.net.path? For
> instance, I have (in theory) 4 points connected to a network. I want
> to find the distance of the line segments between points 1 and 4, 2
> and 4, & 3 and 4.
> 
> I want to: run v.net.path once by passing multiple parameters; get
> vector line output of each of these three paths found by v.net.path
> in one output file; calculate the distance of each line from the file
> using v.to.db.
> 
> Since this is not a module of GRASS which I have worked with in the
> past, I am wondering if this is possible.

Sure, as mentioned on the man page:

"Nodes can be piped into the program from file or from stdin. The syntax 
is as follows:

id start_point_category end_point_category

or

id start_point_x start_point_y end_point_x end_point_y"


So to take your example, and assuming that 1,2,3,4 are category values 
of existing points:

Create a file containing:

1 1 4
2 2 4
3 3 4

and feed it to v.net.path with the file= parameter.

You will then get one vector map with severals lines which have the 
category values used in the first column of your file.

Moritz


More information about the grass-user mailing list