Hi,
I’m trying to extract the outlet location from the
r.stream.extract stream_vector=stream attribute.
In particular the manual for r.stream.extract reports:
“In layer 2, categories are identical to type_code in layer 1 with additional category 2 = outlet for outlet points.”
I want to be able to extract only the points of layer 2 where category = 2.
However when I run
v.db.connect -p map=stream
Vector map is connected by:
layer <1/stream> table in database </tmp/grass7-ga254-12721/tmploc/PERMANENT/sqlite/sqlite.db> through driver with key
I can see only layer 1 (which does not contain category 2).
Is there a way to connect to layer 2?
How I can be sure that also layer 2 has been created and is not missing?
Thanks
Could you post a reproducible example with North Carolina samle data?
(being tight on time it would help)
Best
Markus
On Thu, Apr 23, 2020 at 8:53 PM Giuseppe Amatulli
<giuseppe.amatulli@gmail.com> wrote:
Hi,
I'm trying to extract the outlet location from the
r.stream.extract stream_vector=stream attribute.
In particular the manual for r.stream.extract reports:
"In layer 2, categories are identical to type_code in layer 1 with additional category 2 = outlet for outlet points."
I want to be able to extract only the points of layer 2 where category = 2.
However when I run
v.db.connect -p map=stream
Vector map <stream> is connected by:
layer <1/stream> table <stream> in database </tmp/grass7-ga254-12721/tmploc/PERMANENT/sqlite/sqlite.db> through driver <sqlite> with key <cat>
I can see only layer 1 (which does not contain category 2).
Is there a way to connect to layer 2?
How I can be sure that also layer 2 has been created and is not missing?
Thanks
Giuseppe
GRASS 7.6.0 (tmploc):/gpfs/scratch60/fas/sbsc/ga254/dataproces/MERIT_HYDRO > v.info map=stream
+----------------------------------------------------------------------------+
| Name: stream |
| Mapset: PERMANENT |
| Location: tmploc |
| Database: /tmp/grass7-ga254-25033 |
| Title: |
| Map scale: 1:1 |
| Name of creator: ga254 |
| Organization: |
| Source date: Thu Apr 23 14:42:51 2020 |
| Timestamp (first layer): none |
|----------------------------------------------------------------------------|
| Map format: native |
|----------------------------------------------------------------------------|
| Type of map: vector (level: 2) |
| |
| Number of points: 250905 Number of centroids: 0 |
| Number of lines: 245570 Number of boundaries: 0 |
| Number of areas: 0 Number of islands: 0 |
| |
| Map is 3D: No |
| Number of dblinks: 1 |
| |
| Projection: Latitude-Longitude |
| |
| N: 77:06:40.5N S: 73:10:55.5N |
| E: 158:07:46.5E W: 135:26:34.5E |
| |
| Digitization threshold: 0 |
| Comment: |
| |
+----------------------------------------------------------------------------+
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.
v.db.addtable map=final_outlets column=‘src_cat int’
Thanks Huidae (& Markus),
I was writing to the list when I get your message.
In the end, I discover that the outlet are visible by v.category
v.category input=stream layer=2 type=point option=print
and I was able to directly convert to raster by
v.to.rast input=stream type=point use=cat label_column=type_code output=outlet cats=2
Probably is good to insert in the manual that the layer=2 is visible with v.category.
Thanks again
Giuseppe
p.s. I will write another message concerning some border effect in r.stream.basins
(attachments)
···
Giuseppe Amatulli, Ph.D.
Research scientist at
School of Forestry & Environmental Studies
Center for Research Computing
Yale University
New Haven, CT, USA
06511