[GRASS-user] How to 'double mask' an area

Thomas Adams tea3rd at gmail.com
Sun May 20 07:39:44 PDT 2018


Thank you Moritz,

I was (stupidly) trying to use v.select instead of v.overlay, and was
wondering why v.select was not doing what I wanted... ugh. v.overlay give
me precisely what I need!

Thank you,
Tom

On Sun, May 20, 2018 at 9:59 AM, Moritz Lennert <
mlennert at club.worldonline.be> wrote:

> Le Sun, 20 May 2018 09:22:44 -0400,
> Thomas Adams <tea3rd at gmail.com> a écrit :
>
> > Hi all,
> >
> > I've calculated RUSLE over a large region. I want to to mask
> > individual watershed areas (which I can do, no problem here) but
> > then, over a buffered path (so, a strip) crossing the watershed, I
> > want to calculate the average RULSE value. This is something like
> > double masking an area.
> >
> > Any suggestions how to take the second step? Ideally, I would like to
> > be able to intersect the watershed boundary with the vector path and
> > use the intersected region as the mask, but I can't figure out how to
> > get the intersected region between the vector path and the eatershed
> > boundary.
> >
>
> You can go either the vector way, or the raster way.
>
> (untested)
>
> Vector:
>
> r.to.vect -tv watershed out=watershed type=area
> v.overlay ain=path bin=watershed out=double_mask
> r.mask vector=double_mask
>
> Raster:
>
> v.to.rast path out=path use=val
> r.mapcalc "doublemask = if(isnull(path) || isnull(watershed), null(),
> 1)"
> r.mask raster=doublemask
>
>
> Other means exist to replace the r.mapcalc call (e.g. r.cross). Up to
> you to test what is easiest/most efficient for you.
>
> Moritz
>



--
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20180520/21e390b7/attachment-0001.html>


More information about the grass-user mailing list