[GRASS-user] r.mapcalc help on eliminating negative values

Markus Metz markus.metz.giswork at googlemail.com
Wed Oct 6 06:16:36 EDT 2010


Luisa Peña wrote:
> Greetings
> I'm having some unexpected difficulties on setting negative valeus to null
> using r.mapcalc.
> I have a raster named d_data (DCELL) with  the following range of values
>  |   Range of data:    min = -0.001399  max = 0.356480
> Only a few values are negative so I want to set them to null
> I have used this expression
> if(d_cell at National <0 , null(), d_cell at National)

the raster is named d_data, not d_cell, so why not e.g.
r.mapcalc "d_cell = if(d_data at National < 0 , null(), d_data at National)"
?

Also, g.region -p rast=d_data could do wonders before running r.mapcalc

Markus M


> and when i do r.info output I get:
> |   Data Type:    DCELL
>  |   Range of data:    min = nan  max = nan
> Which is not expected
> What am I doing wrong in this expression?
> Thanks
> Luisa
> _______________________________________________
> grass-user mailing list
> grass-user at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-user
>
>


More information about the grass-user mailing list