[GRASS-user] Another r.stream.extract question

Markus Metz markus.metz.giswork at gmail.com
Wed Nov 1 00:47:38 PDT 2017


On Tue, Oct 31, 2017 at 9:56 PM, Bartolomei.Chris <
Bartolomei.Chris at ensco.com> wrote:
>
> Hi all - While I see r.stream.extract is up for discussion (I didn't want
to jump in on Rich's thread) could I ask for a bit of help?
>
> I'm trying to get the cat values in layer 2 of the stream vector map that
r.stream.extract creates into a separate column of layer 1 of the same
map... clear as mud? Can I create a layer 3 with the cat values from layer
1 and then create a new column and populate it with the cat values from
layer 2? Is there a way in the SQLite to tell it to select attributes from
2 different layers?
>
>
> In more detail:  r.stream.extract creates a vector map of the stream
system, layer 1 has CAT values of each of the stream reaches (internal
feature ID) and an attribute for the type of reach (starting reach or
intermediate, values are 0 and 1 respectively). Layer 2 of that same map
has CAT values for the type of reach as well but introduce a value of 2 for
the stream outlet - i.e values 0, 1, and 2 for starting reach, intermediate
reach, and stream outlet(s). The problem is I would like the nodes
(junctions - i.e. type=point) in a point map with their original cat values
(CAT in layer 1) and the reach type values (CAT in layer 2) as the
attributes.

For the most downstream segment, there are two points: the start point of
that stream segment and the outlet. Both have the same CAT value. Therefore
you can not load category values from layer 2 to layer 1 because a given
CAT value in layer 1 can be both an intermediate point and an outlet.

You could create unique cat values in a new layer with
v.category type=point layer=3 op=add cat=1 step=1

Then upload categories or attributes from a different layer with e.g.
v.db.addcolumn layer=3 column="reach_type integer"
v.to.db layer=3 column=reach_type option=query query_layer=2
query_column=cat

HTH,

Markus M

> I would think v.extract would work but the attributes are on 2 different
layers.  I tried to create a separate table for layer 2: there are 22 point
features in my stream map but only three records are added to the table for
layer 2 because the key column is "cat" for layer 2 which only has the
values of 0, 1, or 2 for all the features. I'm beside myself trying to
figure out how to combine the two layers... Has anyone done something like
this?
>
> Thanks!
>
> Chris
>
>
> Chris Bartolomei P.E.
> bartolomei.chris at ensco.com
>
> ________________________________
>
> The information contained in this email message is intended only for the
use of the individual(s) to whom it is addressed and may contain
information that is privileged and sensitive. If you are not the intended
recipient, or otherwise have received this communication in error, please
notify the sender immediately by email at the above referenced address and
note that any further dissemination, distribution or copying of this
communication is strictly prohibited.
>
> The U.S. Export Control Laws regulate the export and re-export of
technology originating in the United States. This includes the electronic
transmission of information and software to foreign countries and to
certain foreign nationals. Recipient agrees to abide by these laws and
their regulations -- including the U.S. Department of Commerce Export
Administration Regulations and the U.S. Department of State International
Traffic in Arms Regulations -- and not to transfer, by electronic
transmission or otherwise, any content derived from this email to either a
foreign national or a foreign destination in violation of such laws.
> _______________________________________________
> 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/20171101/3f4175ea/attachment.html>


More information about the grass-user mailing list