[GRASS-user] mapcalc NULL issue

Carlos "Guâno" Grohmann carlos.grohmann at gmail.com
Thu Jun 8 07:43:03 EDT 2006

Hello all.

I have two rasters (SRTM_V2), one has data on the continental area,
with zero values in the ocean. The other (SRTM_30 PLUS) has values for
all region. I'd like to patch them, using r.mapcalc, like this:
if srtmv2==0 OR srtmv2==NULL, then use value from srtm30plus, else srtmv2.

I tried this in mapcalc:

test=if(A==0||isnull(A), B,A)

but it didn't work. the result was the same as test=if(A==0, B,A).

So how can I manage to get the condition for zero and null at the same
time? I mean, I can do this in a single operation, right? Or do I need
to make two operations?


              Carlos Henrique Grohmann - Guano
  Geologist M.Sc  - Doctorate Student at IGc-USP - Brazil
Linux User #89721  - carlos dot grohmann at gmail dot com
"Good morning, doctors. I have taken the liberty of removing Windows
95 from my hard drive."
--The winning entry in a "What were HAL's first words" contest judged
by 2001: A SPACE ODYSSEY creator Arthur C. Clarke

More information about the grass-user mailing list