[GRASS-user] Change NaN to 0 with r.mapcalc(or whatever)?

Moskovitz, Bob Bob.Moskovitz at conservation.ca.gov
Wed May 21 13:06:02 EDT 2008


Based on what I read from that link I tried:
	r.mapcalc "q50_eh_nonan = if(q50_eh != q50_eh,null(),q50_eh)"

It assigned nan to 0.  It would be great if r.null can use such a simple trick.

> -----Original Message-----
> From: Hamish [mailto:hamish_b at yahoo.com]
> Sent: Tuesday, May 20, 2008 8:34 PM
> To: Grass-User (E-mail); Moskovitz, Bob
> Subject: Re: [GRASS-user] Change NaN to 0 with r.mapcalc(or whatever)?
> 
> 
> Bob wrote:
> > Is there a way to r.mapcalc or some other command to change
> > NaN values in rasters to another value?
> 
> 
> If you mean real "nan" not grass NULL values, see this thread 
> from the grass-dev list from a few days ago:
>   http://thread.gmane.org/gmane.comp.gis.grass.devel/27160
> and the question of where they came from.
> 
> 
> For grass NULL values, r.null is your friend, or 
> isnull(mapname) in r.mapcalc.
> 
> 
> Hamish
> 
> 
> 
> 
>       
> 
> 


More information about the grass-user mailing list