[GRASS-user] select only patches with 1-cell width

Blumentrath, Stefan Stefan.Blumentrath at nina.no
Thu Apr 20 11:47:42 PDT 2017


Sorry, forgot to mention, that water has to be NULL and everything else NOT NULL before you run 1) (r.grow.distance), and in 3) (r.mapcalc) the value has to be below or equal the resolution…

Cheers
Stefan

From: Blumentrath, Stefan
Sent: torsdag 20. april 2017 20.14
To: 'Giuseppe Amatulli' <giuseppe.amatulli at gmail.com>; GRASS user list <grass-user at lists.osgeo.org>
Subject: RE: [GRASS-user] select only patches with 1-cell width

Hi Giuseppe,

Not a single command, but you could:

1.       run r.grow.distance, then

2.       r.neighbors with 5 pixels circular neighborhood and maximum statistics

3.       r.mapcalc expression=”result=max_nbh_5<=1,1,null()”

If you want to get a vector lines result you might need r.thin and v.to.rast after that.

Hope that helps!

Cheers
Stefan


From: grass-user [mailto:grass-user-bounces at lists.osgeo.org] On Behalf Of Giuseppe Amatulli
Sent: torsdag 20. april 2017 18.06
To: GRASS user list <grass-user at lists.osgeo.org<mailto:grass-user at lists.osgeo.org>>
Subject: [GRASS-user] select only patches with 1-cell width


Hi,
I have a huge streams/lakes dataset and I want to be able to select only water bodies (streams) with 1-cell width.
In other words if i have this raster


[Inline images 1]

I want to select only this streams

[Inline images 2]


Any suggestion or grass command that does such operation.
Thank you
Best
--
Giuseppe Amatulli, Ph.D.

Research scientist at
Yale School of Forestry & Environmental Studies
Yale Center for Research Computing
Center for Science and Social Science Information
New Haven, 06511
Teaching: http://spatial-ecology.org
Work:  https://environment.yale.edu/profile/giuseppe-amatulli/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20170420/626490de/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image003.png
Type: image/png
Size: 16449 bytes
Desc: image003.png
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20170420/626490de/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image004.png
Type: image/png
Size: 11701 bytes
Desc: image004.png
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20170420/626490de/attachment-0003.png>


More information about the grass-user mailing list