[GRASSLIST:10627] Re: r.mapcalc problem

Silvia Franceschi silvia.franceschi at ing.unitn.it
Tue Feb 28 11:41:26 EST 2006


I tried and it goes, the right command is:

r.mapcalc "result=if(isnull(dsm),dtm,dsm)"

Thanks to all for the help

Silvia

> 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

-- 
____________________________________________________________________________
HydroloGIS - Environmental Open Source Solutions
Via Siemens, 19
39100 Bolzano
www.hydrologis.com

Silvia Franceschi
Environmental Engineer
tel: +390471068066
mobile:  +393384501332
email: silvia.franceschi at hydrologis.com
____________________________________________________________________________


-- 
____________________________________________________________________________
HydroloGIS - Environmental Open Source Solutions
Via Siemens, 19
39100 Bolzano
www.hydrologis.com

Silvia Franceschi
Environmental Engineer
tel: +390471068066
mobile:  +393384501332
email: silvia.franceschi at hydrologis.com
____________________________________________________________________________




More information about the grass-user mailing list