[GRASS-user] Another r.stream.extract question
Bartolomei.Chris
Bartolomei.Chris at ensco.com
Fri Nov 3 01:29:40 PDT 2017
Thanks Markus! I'll give that a try
[😊]
Chris
Chris Bartolomei P.E.
bartolomei.chris at ensco.com
________________________________
From: Markus Metz <markus.metz.giswork at gmail.com>
Sent: Wednesday, November 1, 2017 12:47:38 AM
To: Bartolomei.Chris
Cc: grass-user
Subject: Re: [GRASS-user] Another r.stream.extract question
On Tue, Oct 31, 2017 at 9:56 PM, Bartolomei.Chris <Bartolomei.Chris at ensco.com<mailto: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<mailto: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<mailto:grass-user at lists.osgeo.org>
> https://lists.osgeo.org/mailman/listinfo/grass-user<https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.osgeo.org_mailman_listinfo_grass-2Duser&d=DwMFaQ&c=DsZY2bea7iNIzyp-7sZ0t0F2UfNQZUfZhEPCv_2wBI0&r=O31ltou6ygJL2Y01kQyNJJD2kiILIsbyz2V0Hn4lFUY&m=4SQDbkR7eW7z-7HXDqX1C2U4ZKzmmyRSuCZ1e51NqPs&s=Tze3Krslcggxq8O_Y7u90-1xYOyemRaucjmT2DgRmkE&e=>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OutlookEmoji-😊.png
Type: image/png
Size: 488 bytes
Desc: OutlookEmoji-😊.png
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20171103/a964192a/attachment.png>
More information about the grass-user
mailing list