[GRASS-user] MASK does not do it's work (?) with r.mapcalc -- Again!

Nikos Alexandris nikos.alexandris at felis.uni-freiburg.de
Wed Jan 23 02:42:37 EST 2008


Thanks for the important clarification.

Do you think it would be useful to add this information in the manual of
r.mask?


On Wed, 2008-01-23 at 04:18 +0000, Glynn Clements wrote:
> nikos.alexandris at felis.uni-freiburg.de wrote:
> 
> > Thank you for the attention Moritz.
> > 
> > I understand MASK as a boolean map with (let's say) "1"
> > (for true) and "0" (for false).
> > 
> > The r.info (the one I provided in my previous e-mail) is
> > about the raster data I want to use to create a MASK and
> > not the MASK itself.
> > 
> > Should I understand that only "integer" raster data are
> > suitable to create a MASK?
> 
> The mask is read as an integer map. If MASK is actually a
> floating-point map, the values will be converted to integers using the
> map's quantisation rules (this defaults to round-to-nearest, but can
> be changed with r.quant).
> 
> Your NDVI20060.35 map has a range of 0.001304 to 0.349991, so all of
> those values will be rounded to zero.
> 
> > I understand (reading the r.mapcalc functionality) that one
> > can use any kind of raster data (floating point) and create
> > a MASK which contains a "1" for the pixels that have any
> > value besides "NULL".
> > 
> > So I expected to have a "1" wherever there was a value in
> > my NDVI2006 file.
> > 
> > Maybe I use it wrong(?)
> > 
> > Should I specify to assign a value of "1" for all non-NULL
> > source pixels?
> > 
> > I'll try with "mask = a != 0" as described in the r.mapcalc
> > manual.
> 
> If you want to create a mask based upon null/non-null, use e.g.:
> 
> 	r.mapcalc "MASK = !isnull(inmap)"
> 
-- 
Nikos Alexandris
.
Department of Remote Sensing & Landscape Information Systems
Faculty of Forestry & Environmental Sciences, Albert-Ludwigs-University Freiburg
.
Tel.  +49 (0) 761 203 3697 / Fax.  +49 (0) 761 203 3701 / Skype: Nikos.Alexandris
.
Address: Tennenbacher str. 4, D-79106 Freiburg i. Br., Germany
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.osgeo.org/pipermail/grass-user/attachments/20080123/649386ad/attachment.bin


More information about the grass-user mailing list