[GRASSLIST:5549] Re: Using "maskmap" on raster data

H Bowman hamish_nospam at yahoo.com
Thu Feb 13 23:49:24 EST 2003


> I'd like to ask about using some "maskmap" on existing map. I've
> got binmary mask describing some important area. How can I
> "thinner" some raster to contain only data from this area? (other
> data should be NULL or zero)


r.mapcalc new_rast="if((mask_rast, old_rast, null())"

(translated: if raster cell exists in 'mask_rast', use value from
'old_rast', otherwise NULL.)

mind the logic of "if(NULL, , )" ...
use if(isnull(mask_rast), null(), old_rast) instead..

The r.mapcalc help page is pretty helpful, anyway.




More information about the grass-user mailing list