[GRASS-user] change the cell value of a geotiff

Hamish hamish_b at yahoo.com
Wed Jan 20 21:31:19 EST 2010


maven wrote:
>>> I have a geotiff now, and some cells have a
>>> not-expected value, so I want to Interpolation them, and I notice
>>> that there is a command named r.fillnull, however the cell
>>> to be changed is not null, so I want to :

Hamish:
> > try r.null.


>  |   Range of data:    min =
> -1267650600228229401496703205376.000000  max = 4 |


> 2)then I use r.null to set the null value to null:  
> r.null setnull=-1.26765060022823e+030
>
> 3) I use the r.info again to see if it is changed :
> 
> r.info -r map=aaa at PERMANENT
>
> min=-1.26765060022823e+030
> max=498.5
..
>  It seems that the valuse are  not changed to
> null.
> 
> I wonder why?

probably due to floating point precision issues (why Glynn recommended
to use a range instead of an exact value, see
  http://docs.sun.com/source/806-3568/ncg_goldberg.html  )


So going back to the r.mapcalc method, except use less-than some minimum
value instead of trying to do an exact equality:


r.mapcalc "clean_map = if( dirty_map < -9999, null(), dirty_map)"


meaning:
 if (this is true), then (set it to this), otherwise (set it to this)




Hamish



      


More information about the grass-user mailing list