[GRASS-user] GRASS7 r.mapcalc not working

César Augusto Ramírez Franco caesarivs at gmail.com
Thu Mar 13 09:28:07 PDT 2014


Hello Markus, I'm using the terminal on Debian Testing/SID

I'm trying to make a mask for the pixels of a landsat 8 image inside a basin

mask1 is my basin, and mask2 is the cloudmask of the landsat image

I calculated the cloudmask with

r.mapcalc "cloudmask = if( (BQA ==1 || BQA >= 49152), null(), 1)"

Maybe I'm using the wrong logic inside the if statement? How do I get
r.mapcalc to make an intersection of the two masks other than summing them?

Thanks

2014-03-13 10:47 GMT-05:00 Markus Neteler <neteler at osgeo.org>:

> Hello Cèsar,
>
> On Thu, Mar 13, 2014 at 2:09 PM, César Augusto Ramírez Franco
> <caesarivs at gmail.com> wrote:
> > Hello list,
> >
> > Is anyone having issues with r.mapcalc on grass7 r59245?
> >
> > I'm getting:
> >
> > syntax error, unexpected ',', expecting $end
> > Parse error
> > ERROR: parse error
> >
> > Everytime I try to do an "if(a,b,c)" statement like:
> >
> > "mapmask = if(mask1 && mask2, mask2, null())"
> >
> > I found another way to do it by doing:
> >
> > "mapmask = mask1 + mask2"
> >
> > But I still think r.mapcalc is misbeheaving on this revision
>
> I tried here:
>
> GRASS 7.0.svn (patUTM32):~ > r.mapcalc "mask1 = 1"
>  100%
> GRASS 7.0.svn (patUTM32):~ > r.mapcalc "mask2 = 2"
>  100%
> GRASS 7.0.svn (patUTM32):~ > r.mapcalc "mapmask = if(mask1 && mask2,
> mask2, null())"
>  100%
> GRASS 7.0.svn (patUTM32):~/software/grass70 > g.version -g
> version=7.0.svn
> date=2014
> revision=59246M
> build_date=2014-03-13
>
> Do you use the wxGUI command line (maybe eating the & chars?) or the
> terminal?
> And which operating system?
>
> Markus
>



-- 
*César Augusto Ramírez Franco*
Laboratorio de Sistemas Complejos Naturales
Escuela de Geociencias
Facultad de Ciencias
Universidad Nacional de Colombia - Sede Medellín
Teléfono: (57-4) 430 9369 - 301 389 5607
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20140313/3c84ac43/attachment.html>


More information about the grass-user mailing list