[GRASS-user] About r.neighbors weight usage

Glynn Clements glynn at gclements.plus.com
Mon Jun 2 22:11:44 PDT 2014


m roy wrote:

> i'm trying to use r.neighbors with the weight option along with the sum function;
> maibe i do not get how it's supposed to work...
> 
> this is what i'm using:
> 
> Neighborhood operation: sum
> Neighborhood size: 3
> 
> Weight:
> 
> 0 0 0
> -1 0 1
> 0 0 0
> 
> and i get a null result.

You get a null result if the total number of values is zero. For a
weighted sum, "the total number of values" is the sum of the weights,
which in this case is zero.

I'd suggest that r.mfilter may be more appropriate for implementing
discrete convolution (FIR) filters.

-- 
Glynn Clements <glynn at gclements.plus.com>


More information about the grass-user mailing list