[GRASS-dev] formatting expressions for r.mapcalc in GRASS6.4.3

Glynn Clements glynn at gclements.plus.com
Fri Mar 15 10:17:14 PDT 2013


Helmut Kudrnovsky wrote:

> - working:
> 
> r.mapcalc
> ndvi3=float(lsat7_2002_40-lsat7_2002_30)/float(lsat7_2002_40+lsat7_2002_30)
> (Fri Feb 15 16:23:42 2013) Command finished (0 sec)  
> 
> r.mapcalc urban1_30m=if(landuse96_28m==1,1,0)+if(landuse96_28m==2,2,0)          
> (Fri Feb 15 16:24:24 2013) Command finished (0 sec)   
> 
> - not working (as Anna mentioned caused by ||):
> 
> r.mapcalc urban2_30m=if(landuse96_28m==1 ||
> landuse96_28m==2,landuse96_28m,null()
> r.mapcalc MASK=if((elevation<100 && elevation>60) && (landuse96_28m==1 ||
> landuse96_28m==2),1,null())

Why do you think that the problem is caused by || rather than the
spaces?

-- 
Glynn Clements <glynn at gclements.plus.com>


More information about the grass-dev mailing list