[GRASS-dev] Re: [GRASS-user] r.neighbour and r.mask

Glynn Clements glynn at gclements.plus.com
Wed Jul 8 11:33:36 EDT 2009


Hamish wrote:

> > I am running r.neighbors to compute some moving windows
> > stats. As my region is irregular, many of central pixels
> > will be NULL. If I use r.mask, it means that when I run
> > r.neighbours the processing will be faster than when I
> > not set r.mask
> 
> 
> .... I wonder, if the gather.c loops in r.neighbors come across
> a NULL if they should immediately break out of the for loop^2
> and just set everything to NULL, as that is what the result
> will be if it has any NULLs in it. [or maybe the test on each
> cell is more expensive than the gathering process.  ??]

r.neighbors doesn't propagate nulls, but computes the aggregate over
the non-null cells. It doesn't even have an option to propagate nulls.

Adding such a flag would be reasonable, as would aborting the gather
loop at the first null when the flag is used. But the existing
behaviour certainly shouldn't be changed in 6.x.

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


More information about the grass-dev mailing list