[GRASS-user] r.mapcalc(nulls into 0)

Eloi Ribeiro eloi.ribeiro at gmail.com
Wed Jul 11 05:02:50 PDT 2012


Hi,

I am trying to do something really simple but not finding the right way to
do it.
I need to convert nulls into zeros. I have done this:
*r.mapcalc "raster2 = if(raster1 = null(), 0, raster1)"  *
*r.mapcalc "raster2 = if(raster1 == null(), 0, raster1)"  **
*
But this convert all cells into nulls.

I have tried another approach with r.reclass, rules:
null/null()/no data/nodata...=0
1=1
2=2
3=2
4=2
5=2

No fun, all I get is an ERROR: null/null()/no data/nodata...=0

What I'm doing wrong?

Eloi Ribeiro
GIS Analyst
39,45º -0,40º
flavors.me/eloiribeiro
-------------- pr?xima parte ----------
Um anexo em HTML foi limpo...
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20120711/1220b42b/attachment.html>


More information about the grass-user mailing list