I have a vector map of a stream network and want to find the distance
between two points on the main stem. I have the geographic coordinates of
each point on the line representing the stream. I tried v.what but I'm not
comfortable that gave me the correct answer.
The line between the two points is multiple segments where there are
confluences with feeder streams.
What module, used with the GUI or on the command line, will allow me to
calculate the distance along the stream between two identified points?
On Sat, Feb 27, 2010 at 11:09 AM, Rich Shepard <rshepard@appl-ecosys.com> wrote:
I have a vector map of a stream network and want to find the distance
between two points on the main stem. I have the geographic coordinates of
each point on the line representing the stream. I tried v.what but I'm not
comfortable that gave me the correct answer.
The line between the two points is multiple segments where there are
confluences with feeder streams.
What module, used with the GUI or on the command line, will allow me to
calculate the distance along the stream between two identified points?
WARNING: Point 242551.880000,432149.700000 is not reachable from point
0.600000,431305.070000
WARNING: 1 destination(s) unreachable (including points out of threshold)
Here is the contents of 'nodes':
242856.60 431305.07 242551.88 432149.70
Any idea what I've done incorrectly? Those points are on the stream itself
on the map.
Oops! I forgot the 'id' at the beginning of the line.
So, after adding that I get a new warning:
WARNING: Wrong input format: id 242856.60 431305.07 242551.88 432149.70
WARNING: [1] input format errors
The man page says:
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
Points specified by category must be exactly on network nodes, while, when
specifying coordinates, the next node to a given coordinate pair is used.
What I tried was to put the upstream easting upstream northing downstream
easting downstream northing as the points.
I have a vector map of a stream network and want to find the distance
between two points on the main stem. I have the geographic coordinates of
each point on the line representing the stream. I tried v.what but I'm not
comfortable that gave me the correct answer.
The line between the two points is multiple segments where there are
confluences with feeder streams.
What module, used with the GUI or on the command line, will allow me to
calculate the distance along the stream between two identified points?
On Sun, Feb 28, 2010 at 02:09, Rich Shepard <rshepard@appl-ecosys.com> wrote:
On Sat, 27 Feb 2010, Rich Shepard wrote:
242856.60 431305.07 242551.88 432149.70
Oops! I forgot the 'id' at the beginning of the line.
So, after adding that I get a new warning:
WARNING: Wrong input format: id 242856.60 431305.07 242551.88 432149.70
WARNING: [1] input format errors
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
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
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:
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
I tried using v.in.ascii to add those two points to a file named
'startend', but when I specified that map name it apparently was not added
to the vector directory.
What am I still doing incorrectly? Or, is there a different module that
will return the distance along the stream vector map between those two
defined points?
On Mon, Mar 8, 2010 at 19:07, Rich Shepard <rshepard@appl-ecosys.com> wrote:
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
Hi Rich,
Now you are mixing with the format for v.in.ascii. The v.net.path fomat is:
id start_point_x start_point_y end_point_x end_point_y
where id is a number, then comes the x and y coordinate points for the
starting point and then comes the x and y coordinate pair for the end
point. All fields are separated by a single space. Hope this helps!
The id will become the cat of the new shortest path. So if you specify
multiple lines toy will get multiple paths
For a trivial example you might have (the coordinates are going to be
different in your map)
1 11.22 43.22 32.12 45.21
Which will find the shortest path from point (11.22, 43.22) to point
(32.12, 45.21) along your stream network. This single line will be
stored in the output map (stream_length in your case). Now you can use
v.to.db. to query the length of this (or all if you have multiple
paths) like this:
> 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:
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: