[GRASS-user] Merging connected stream lines

Markus Metz markus.metz.giswork at gmail.com
Sun Oct 29 09:07:06 PDT 2017


On Sat, Oct 28, 2017 at 3:18 PM, Huidae Cho <grass4u at gmail.com> wrote:
>
> BTW, let me understand weakly vs strongly connected components generated
by v.net.components.
>
> Strongly connected: All paths between nodes u and v should have the same
direction.

>From the manual:
"there are directed paths from u to v and from v to u"

You can create directed graphs by assigning costs according to line
direction with the arc_column and arc_backward_column options. The forward
or backward direction of a line can be closed by setting costs to -1.

By default, (no cost columns given), line lengths are used as costs,
ignoring line direction because 1) line direction can be arbitrary, 2)
typically lines can be traversed in both directions.

Therefore, method=strong only makes sense if both arc_column and
arc_backward_column are given and if some lines are closed in one
direction. Otherwise, strong and weak will give the same results.
>
> Weakly connected: Only requires "connections" between nodes u and v, and
their directions don't matter.

To be precise, u must be reachable from v or v must be reachable from u.
>
> If my understanding is correct, a stream vector map generated by thinning
and converting the stream raster map (flow directions not guaranteed) to
vector would only be weakly connected.
>
> The stream vector output from r.streams.extract would be both strongly
and weakly connected because it honors flow directions.

Different stream networks are always different components. If you use
arc_backward_column and close backward traversal, each stream network is
again broken up into various strongly connected components.

If you use r.thin + r.to.vect + arc_backward_column, a single stream
network might even be broken up into several weakly connected components.

HTH,

Markus M
>
> Please let me know if I'm mistaken.
>
> Thanks.
> Huidae
>
>
>
> On Sat, Oct 28, 2017 at 9:06 AM, Huidae Cho <grass4u at gmail.com> wrote:
>>
>> It's working great! Thanks for the quick implementation. It will help a
lot!
>>
>> Huidae
>>
>> On Fri, Oct 27, 2017 at 3:58 PM, Markus Metz <
markus.metz.giswork at gmail.com> wrote:
>>>
>>>
>>>
>>> On Fri, Oct 27, 2017 at 2:38 PM, Huidae Cho <grass4u at gmail.com> wrote:
>>> >
>>> > [...] I tried your r.stream.extract to extract stream lines and its
output makes much more sense. It would be great if this module also outputs
unique stream "network" numbers.
>>>
>>> Unique stream network numbers are added as new attribute "network" in
trunk r71599.
>>>
>>> Markus M
>>> >
>>> > Thanks.
>>> > Huidae
>>> >
>>> >
>>> > On Fri, Oct 27, 2017 at 8:14 AM, Markus Metz <
markus.metz.giswork at gmail.com> wrote:
>>> >>
>>> >>
>>> >>
>>> >> On Fri, Oct 27, 2017 at 12:52 PM, Huidae Cho <grass4u at gmail.com>
wrote:
>>> >> >
>>> >> > Actually, I'm getting the same error as Markus in the NC dataset.
I recently discleaned and rebuilt the latest SVN.
>>> >>
>>> >> In trunk, this bug appeared with r71267 and was fixed with r71477.
>>> >> In relbr72, this bug appeared with r71268 and was fixed with r71478.
>>> >>
>>> >> Please check your revision.
>>> >>
>>> >> Markus M
>>> >>
>>> >> >
>>> >> > Huidae
>>> >> >
>>> >> > On Thu, Oct 26, 2017 at 4:14 PM, Markus Metz <
markus.metz.giswork at gmail.com> wrote:
>>> >> >>
>>> >> >>
>>> >> >>
>>> >> >> On Thu, Oct 26, 2017 at 5:02 PM, Markus Neteler <neteler at osgeo.org>
wrote:
>>> >> >> >
>>> >> >> > On Thu, Oct 26, 2017 at 9:58 AM, Stefan Blumentrath
>>> >> >> > <Stefan.Blumentrath at nina.no> wrote:
>>> >> >> > > Hi,
>>> >> >> > >
>>> >> >> > > Did you try:
>>> >> >> > >
>>> >> >> > > https://grass.osgeo.org/grass72/manuals/v.net.components.html
>>> >> >> > >
>>> >> >> > > That might give you a common attribute for all connected
lines in your
>>> >> >> > > network…
>>> >> >> >
>>> >> >> > I just tried that with NC but:
>>> >> >> >
>>> >> >> > GRASS 7.3.svn (nc_spm_08_grass7):~ > v.net.components
input=roadsmajor
>>> >> >> > output=roadsmajor_components method=strong
>>> >> >> > Building graph...
>>> >> >> > Registering arcs...
>>> >> >> >  100%
>>> >> >> > Flattening the graph...
>>> >> >> > ERROR: GngFlatten error
>>> >> >> >
>>> >> >> >
>>> >> >> > GRASS 7.3.svn (nc_spm_08_grass7):~ > v.net.components
input=railroads
>>> >> >> > output=railroads_components method=strong
>>> >> >> > Building graph...
>>> >> >> > Registering arcs...
>>> >> >> >  100%
>>> >> >> > Flattening the graph...
>>> >> >> > ERROR: GngFlatten error
>>> >> >> >
>>> >> >> > Does the network need any special treatment?
>>> >> >>
>>> >> >> I can not reproduce these errors. Please update your local copy:
>>> >> >> make distclean
>>> >> >> svn --no-ignore status
>>> >> >> svn up
>>> >> >> configure
>>> >> >> make
>>> >> >>
>>> >> >> Markus M
>>> >> >> >
>>> >> >> > Markus
>>> >> >> > _______________________________________________
>>> >> >> > grass-user mailing list
>>> >> >> > grass-user at lists.osgeo.org
>>> >> >> > https://lists.osgeo.org/mailman/listinfo/grass-user
>>> >> >>
>>> >> >>
>>> >> >> _______________________________________________
>>> >> >> grass-user mailing list
>>> >> >> grass-user at lists.osgeo.org
>>> >> >> https://lists.osgeo.org/mailman/listinfo/grass-user
>>> >> >
>>> >> >
>>> >
>>> >
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20171029/d070e11d/attachment.html>


More information about the grass-user mailing list