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

Blumentrath, Stefan Stefan.Blumentrath at nina.no
Thu Apr 20 11:13:57 PDT 2017

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!


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>
Subject: [GRASS-user] select only patches with 1-cell width

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
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/341203e1/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 16449 bytes
Desc: image001.png
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20170420/341203e1/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image002.png
Type: image/png
Size: 11701 bytes
Desc: image002.png
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20170420/341203e1/attachment-0003.png>

More information about the grass-user mailing list