<div dir="ltr"><div>Giuseppe,</div><div><br></div><div>r.stream.extract does not link a table to layer 2, but layer 2 is there. You can display outlets in GUI. Select layer=2 and cat=2 in d.vect.</div><div><div><img src="cid:ii_k9lxz1h70" alt="image.png" width="416" height="318"><br></div><div><br></div><div>Now, you want to extract the outlets.</div><div><br></div><div>v.extract input=extract_output layer=2 cat=2 output=outlets1</div><div><br></div><div>The outlets are still in layer 2 in the outlets1 map and they all have the same cat (2).<br></div><div>v.category map=outlets1 option=report</div><div><br></div><div>Change the layer from 2 to 1.</div><div>v.category input=outlets1 layer=2,1 option=chlayer output=outlets2</div><div><br></div><div>Delete all cats (2) because they're just the same.(useless).</div><div>v.category input=outlets2 option=del cat=-1 output=outlets3<br></div><div><br></div><div>Add unique cats.</div><div>v.category input=outlets3 option=add output=final_outlets</div><div><br></div><div>Let's see.</div><div>v.report map=final_outlets option=coor</div><div><br></div><div>How do you link these points in final_outlets back to the original extract_output? Now, you need to add a table to final_outlets.</div><div>v.db.addtable map=final_outlets column='src_cat int'</div><div><br></div><div>v.what.vect map=final_outlets col=src_cat query_map=extract_output query_column=cat</div><div><div><br></div><div>Check<br></div><div>v.report map=final_outlets option=coor</div><div><br></div><div>Hope this helps.</div><div><br></div><div>Best,</div><div>Huidae<br></div></div><div><br></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Apr 27, 2020 at 6:25 AM Markus Neteler <<a href="mailto:neteler@osgeo.org">neteler@osgeo.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Giuseppe,<br>
<br>
Could you post a reproducible example with North Carolina samle data?<br>
(being tight on time it would help)<br>
<br>
Best<br>
Markus<br>
<br>
On Thu, Apr 23, 2020 at 8:53 PM Giuseppe Amatulli<br>
<<a href="mailto:giuseppe.amatulli@gmail.com" target="_blank">giuseppe.amatulli@gmail.com</a>> wrote:<br>
><br>
> Hi,<br>
> I'm trying to extract the outlet location from the<br>
> r.stream.extract stream_vector=stream attribute.<br>
> In particular the manual for r.stream.extract reports:<br>
><br>
> "In layer 2, categories are identical to type_code in layer 1 with additional category 2 = outlet for outlet points."<br>
><br>
> I want to be able to extract only the points of layer 2 where category = 2.<br>
> However when I run<br>
><br>
> v.db.connect -p map=stream<br>
> Vector map <stream> is connected by:<br>
> layer <1/stream> table <stream> in database </tmp/grass7-ga254-12721/tmploc/PERMANENT/sqlite/sqlite.db> through driver <sqlite> with key <cat><br>
><br>
> I can see only layer 1 (which does not contain category 2).<br>
><br>
> Is there a way to connect to layer 2?<br>
> How I can be sure that also layer 2 has been created and is not missing?<br>
> Thanks<br>
> Giuseppe<br>
><br>
> GRASS 7.6.0 (tmploc):/gpfs/scratch60/fas/sbsc/ga254/dataproces/MERIT_HYDRO > <a href="http://v.info" rel="noreferrer" target="_blank">v.info</a> map=stream<br>
> +----------------------------------------------------------------------------+<br>
> | Name: stream |<br>
> | Mapset: PERMANENT |<br>
> | Location: tmploc |<br>
> | Database: /tmp/grass7-ga254-25033 |<br>
> | Title: |<br>
> | Map scale: 1:1 |<br>
> | Name of creator: ga254 |<br>
> | Organization: |<br>
> | Source date: Thu Apr 23 14:42:51 2020 |<br>
> | Timestamp (first layer): none |<br>
> |----------------------------------------------------------------------------|<br>
> | Map format: native |<br>
> |----------------------------------------------------------------------------|<br>
> | Type of map: vector (level: 2) |<br>
> | |<br>
> | Number of points: 250905 Number of centroids: 0 |<br>
> | Number of lines: 245570 Number of boundaries: 0 |<br>
> | Number of areas: 0 Number of islands: 0 |<br>
> | |<br>
> | Map is 3D: No |<br>
> | Number of dblinks: 1 |<br>
> | |<br>
> | Projection: Latitude-Longitude |<br>
> | |<br>
> | N: 77:06:40.5N S: 73:10:55.5N |<br>
> | E: 158:07:46.5E W: 135:26:34.5E |<br>
> | |<br>
> | Digitization threshold: 0 |<br>
> | Comment: |<br>
> | |<br>
> +----------------------------------------------------------------------------+<br>
><br>
><br>
><br>
> --<br>
> Giuseppe Amatulli, Ph.D.<br>
><br>
> Research scientist at<br>
> School of Forestry & Environmental Studies<br>
> Center for Research Computing<br>
> Yale University<br>
> New Haven, CT, USA<br>
> 06511<br>
> Teaching: <a href="http://spatial-ecology.net" rel="noreferrer" target="_blank">http://spatial-ecology.net</a><br>
> Work: <a href="https://environment.yale.edu/profile/giuseppe-amatulli/" rel="noreferrer" target="_blank">https://environment.yale.edu/profile/giuseppe-amatulli/</a><br>
> _______________________________________________<br>
> grass-user mailing list<br>
> <a href="mailto:grass-user@lists.osgeo.org" target="_blank">grass-user@lists.osgeo.org</a><br>
> <a href="https://lists.osgeo.org/mailman/listinfo/grass-user" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/grass-user</a><br>
<br>
<br>
<br>
-- <br>
Markus Neteler, PhD<br>
<a href="https://www.mundialis.de" rel="noreferrer" target="_blank">https://www.mundialis.de</a> - free data with free software<br>
<a href="https://grass.osgeo.org" rel="noreferrer" target="_blank">https://grass.osgeo.org</a><br>
<a href="https://courses.neteler.org/blog" rel="noreferrer" target="_blank">https://courses.neteler.org/blog</a><br>
_______________________________________________<br>
grass-user mailing list<br>
<a href="mailto:grass-user@lists.osgeo.org" target="_blank">grass-user@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/grass-user" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/grass-user</a></blockquote></div><br clear="all"><br>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><span><div><div dir="ltr">Huidae Cho, Ph.D., GISP</div><div dir="ltr">GRASS GIS Developer</div><div><a href="https://idea.isnew.info" target="_blank">https://idea.isnew.info</a><br></div></div></span></div></div></div></div></div></div></div></div></div></div>