I have a network of streams (say, Spearfish or better the new
NC data set at http://mpa.itc.it/grasstutor/data_menu3rd.phtml )
and want to extract a single stream system. Names are lacking,
is there any trick to extract topologically connected lines
into a new map?
On Tue, May 01, 2007 at 12:37:15PM +0200, Markus Neteler wrote:
Hi,
I have a network of streams (say, Spearfish or better the new
NC data set at http://mpa.itc.it/grasstutor/data_menu3rd.phtml )
and want to extract a single stream system. Names are lacking,
is there any trick to extract topologically connected lines
into a new map?
Probably we need some equivalent to the "sides" operator in
v.to.db (which tells you the cats of the left and right polygon).
Some magic which finds the lines which are connected and writes
out some related attribute(s).
> I have a network of streams (say, Spearfish or better the new
> NC data set at http://mpa.itc.it/grasstutor/data_menu3rd.phtml )
> and want to extract a single stream system. Names are lacking,
> is there any trick to extract topologically connected lines
> into a new map?
Probably we need some equivalent to the "sides" operator in
v.to.db (which tells you the cats of the left and right polygon).
Some magic which finds the lines which are connected and writes
out some related attribute(s).
how about v.net.iso? disconnected networks will have infinite cost.
I remember that someone recently wrote a module that will calculate stream
Strahler order. This may well have code that you can use for this task,
since it must calculate whether or not a stream segment has 'tributaries'. I
think that it's posted somewhere--WIKI, Grassaddons, ?
Michael
On 5/2/07 2:04 AM, "Markus Neteler" <neteler@itc.it> wrote:
On Tue, May 01, 2007 at 12:37:15PM +0200, Markus Neteler wrote:
Hi,
I have a network of streams (say, Spearfish or better the new
NC data set at http://mpa.itc.it/grasstutor/data_menu3rd.phtml )
and want to extract a single stream system. Names are lacking,
is there any trick to extract topologically connected lines
into a new map?
Probably we need some equivalent to the "sides" operator in
v.to.db (which tells you the cats of the left and right polygon).
Some magic which finds the lines which are connected and writes
out some related attribute(s).
Ideas welcome,
Markus
__________________________________________
Michael Barton, Professor of Anthropology
School of Human Evolution & Social Change
Center for Social Dynamics & Complexity
Arizona State University
On Wed, May 02, 2007 at 08:05:40AM -0700, Michael Barton wrote:
Markus,
I remember that someone recently wrote a module that will calculate stream
Strahler order. This may well have code that you can use for this task,
since it must calculate whether or not a stream segment has 'tributaries'. I
think that it's posted somewhere--WIKI, Grassaddons, ?
I tried this v.strahler recently but it didn't work (it is in the GRASS
Addons SVN) - for me. Maybe it's still under development. But yes,
this would probably do the job.
I tried this v.strahler recently but it didn't work (it is in the GRASS
Addons SVN) - for me. Maybe it's still under development. But yes,
this would probably do the job.
Hi,
Yes, v.strahler assigns a common identifier to all connected segments.
The code is in forest2tree.c:
StrahForestToTrees() makes use of Vect_get_line_nodes() and
Vect_get_node_line() to accomplish this.
Hints on why the code fails are more than welcome.
A word on why Vect_get_node_line() is hidden in StrahGetNodeLine():
I tried to implement "sloppy" mode where lines need not connect in a
topologically correct way but merely share nodes within a certain distance.
However, this adds a lot of complexity and isn't the point of v.strahler
at all (better run v.clean instead) - so it's defunct for now.
As far as the module "is still under development": well, it should be,
but for the moment I don't find the time. Feel free to hack on the
code if you have a good idea.
\flo
--
Florian Kindl
Institute of Geography
University of Innsbruck
On Wed, May 02, 2007 at 11:35:10PM +1200, Hamish wrote:
Markus Neteler wrote:
> > I have a network of streams (say, Spearfish or better the new
> > NC data set at http://mpa.itc.it/grasstutor/data_menu3rd.phtml )
> > and want to extract a single stream system. Names are lacking,
> > is there any trick to extract topologically connected lines
> > into a new map?
>
> Probably we need some equivalent to the "sides" operator in
> v.to.db (which tells you the cats of the left and right polygon).
> Some magic which finds the lines which are connected and writes
> out some related attribute(s).
how about v.net.iso? disconnected networks will have infinite cost.
v.category myriver option=report
# The network is of 2 categories
# show selected river network
d.vect myriver col=blue cats=1
d.vect myriver col=green cats=2
# now v.extract etc ...
Note that some upper parts of the river network are not found due to
unconnected lines.