[GRASS-user] Can I use r.mapcalc to create "sorted" elevation raster?

Micha Silver micha at arava.co.il
Sun Dec 26 06:48:18 EST 2010


On 26/12/2010 12:51, Catlike wrote:
> Thank you for reading.
> I am trying to use r.mapcalc, through QGIS, to take an elevations raster
> with a wide variety of values and create a new elevations raster which only
> contains those cells that have a value over a certain number (in this case,
> 300 meters).
> Unfortunately, the QGIS graphic user interface does not show me what the
> actual command I create is.
> What I get when I run the command is a new raster in which every cell has
> been converted to equal 300 meters!
> What should I do differently?
I've always found the r.mapcalc gui a bit funny to use. If you 
open a terminal and type:
r.mapcalc elev300="if(elev>300, elev, null() )"
that should get you what you want. The 'if' statement will set 
to NULL anything under 300. And above 300 will get the value 
of the original elevation.



> Again, thank you.


-- 
Micha Silver
http://www.surfaces.co.il/
Arava Development Co.  +972-52-3665918



More information about the grass-user mailing list