[GRASS-user] Calculating Length Between Points On Stream Network

Glynn Clements glynn at gclements.plus.com
Mon Mar 8 18:18:22 EST 2010


Rich Shepard wrote:

> On Mon, 8 Mar 2010, Wolf Bergenheim wrote:
> 
> > The 'id' should not be the string 'id', but rather a unique IDentifier
> > for each point. Usually you will want to use a running number, so that
> > the first is 1 the second is 2 etc...
> > Here is an example of 2 lines:
> > 1 242856.60 431305.07 242551.88 432149.70
> > 2 242866.60 431325.07 242550.88 432140.70
> 
> Wolf,
> 
>    What you show above is the same two points on both lines. I changed the
> file 'nodes' to read:
> 
> 1|242856.60|431305.07
> 2|242551.88|432149.70
> 
>    The command line is:
> 
> GRASS 6.4.0svn (oregonM):/usr4/grassbase > v.net.path in=abernethy_creek
> out=stream_length type=line file=/usr4/grassbase/nodes --o
> 
>    Yet I still see:
> ...
> Graph was built
> WARNING: Wrong input format: 1|242856.60|431305.07
> WARNING: Wrong input format: 2|242551.88|432149.70
> WARNING: [2] input format errors

The input must match one of the scanf() formats:

	"%d %lf %lf %lf %lf"
	"%d %d %d"

In both cases, fields should be separated by whitespace. Each record
specifies a pair of points. In the first case, the start/end
coordinates are given; in the second case, the (integer) category
numbers of the start/end points are given.

AFAICT, if you want to find the shortest distance between two points,
the input should be just:

	1 242856.60 431305.07 242551.88 432149.70

-- 
Glynn Clements <glynn at gclements.plus.com>


More information about the grass-user mailing list