[GRASS-user] mapcalc

Hello all,

I would like to use r.mapcalc to fill the null cells of one raster with the value of the same cells from in a second raster (while leaving all other cells as they are in the first raster).

Clearly I am having some kind of brain frizz because this should be simple but I can’t get it right…

Sorry and thanks for reading,

Rebecca

Thus spake Rebecca Bennett (rabennett@ymail.com):

I would like to use r.mapcalc to fill the null cells of one raster
with the value of the same cells from in a second raster (while
leaving all other cells as they are in the first raster).

rasterA="if(isnull(rasterA), rasterB, rasterA)"

--
A man without a dream in his heart already has one foot in the grave.

just the ticket - thank you Hendrik!


From: Hendrik Hoeth hendrik.hoeth@cern.ch
To: Rebecca Bennett rabennett@ymail.com
Cc: grass-user@lists.osgeo.org
Sent: Monday, 25 July 2011, 22:24
Subject: Re: [GRASS-user] mapcalc

Thus spake Rebecca Bennett (rabennett@ymail.com):

I would like to use r.mapcalc to fill the null cells of one raster
with the value of the same cells from in a second raster (while
leaving all other cells as they are in the first raster).

rasterA=“if(isnull(rasterA), rasterB, rasterA)”


A man without a dream in his heart already has one foot in the grave.

Unless there is a specific reason to use r.mapcalc I would suggest to use r.patch