[GRASSLIST:10626] Re: r.mapcalc problem

ivan marchesini marchesini at unipg.it
Tue Feb 28 10:12:38 EST 2006


try the function, of r.mapcalc, isnull()
it is a new function and it help solving these problems
I don't remember very well the sintax but you can check it on the man
page...

hope this help....




Il giorno mar, 28/02/2006 alle 10.06 +0100, Silvia Franceschi ha
scritto:
> Hi all,
> I am trying to do a mapcalc between two maps, the first one is a dsm (digital 
> surface model) and the second is a dtm (digital terrain model).
> The dsm is defined only where there are features on the surface and the dtm is 
> defined all over the region.
> I would like to fill the holes in the dsm map with the correspondets values of 
> the dtm using a mapcalc:
> 
> r.mpacalc "new_map=if(dsm,dsm,dtm)"
> 
> Using this command I obtain a new map equal to the dsm map.
> 
> If I use these instead:
> 
> r.mpacalc "new_map=if(dsm!=null(),dsm,dtm)"
> r.mpacalc "new_map=if(dsm==null(),dtm,dsm)"
> 
> I obtain two maps with all values nan.
> 
> Do someone knows the right way to do this mapcalc?
> 
> Thanks in advance...
> 
> Silvia
> 
-- 
Ivan Marchesini
Department of Civil and Environmental Engineering
University of Perugia
Via G. Duranti 93/a 
06125
Perugia (Italy)
e-mail: marchesini at unipg.it
        ivan.marchesini at gmail.com
tel: +39(0)755853760
fax: +39(0)755853756







More information about the grass-user mailing list