[GRASS5] Re: [GRASS5]r.neighbors question

Glynn Clements glynn.clements at virgin.net
Thu Mar 7 15:53:51 EST 2002


Kevin Slover wrote:

>     The -z option should be kept, unless the r.neighbors module is changed.
> What I noticed is that it included areas that were equal to null, and set
> those to zero.
> Example using d.what.rast:
> 
> 81:43:52.5W 27:58:22.5N
>  gabby62_rtest.rast in PERMANENT, quant   (0)
>  gabby62_rtest.rast in PERMANENT, actual  (0.000000)no data  -> using
> r.neighbors -z option

Zero is not "no data". Zero is zero, null is "no data".

If you have any rasters where zero represents "no data", they should
be fixed using r.null.

Zero is a legitimate data value, and is handled the same way as any
other data value[1]. Null may be handled specially; e.g. any
calculation which involves a null operand will return a null result.

[1] Or, at least, it should be; anything else is a bug, probably left
over from GRASS 4.3.

>       gabby62.rast in PERMANENT, quant   (Null)
>       gabby62.rast in PERMANENT, actual  (Null)no data -> initial raster
> 
> Maybe this is a bug...but I generally choose not to use the -z option, and
> have found ways to work around the problem.  I work with irregularly shaped
> data sets...and taking out the -z option would make the images that I create
> false...creating more work for me....

Note: when I ask about keeping "-z", the alternative is to always
preserve zero.

-- 
Glynn Clements <glynn.clements at virgin.net>



More information about the grass-dev mailing list