[GRASS-user] r.mapcalc(nulls into 0)
Alberto Pettazzi
alberto.pettazzi at meteogalicia.es
Wed Jul 11 05:12:18 PDT 2012
Hi,
I think you should do
raster2=if(isnull(raster1),0,raster1)
El 11/07/12 14:02, Eloi Ribeiro escribió:
> 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 <http://flavors.me/eloiribeiro>
>
>
> _______________________________________________
> grass-user mailing list
> grass-user at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-user
--
Alberto Pettazzi
MeteoGalicia - Departamento de Climatología y Observación
Consellería de Medio Ambiente, Territorio e Infraestruturas
Rúa de Roma, 6
15707 Santiago de Compostela. A Coruña
Teléfono: +34-881-999646
e-mail: alberto.pettazzi at meteogalicia.es
<mailto:alberto.pettazzi at meteogalicia.es>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20120711/ae0bb9fb/attachment.html>
More information about the grass-user
mailing list