[GRASS-dev] Re: [GRASS-user] circle surrounding neighbors

Glynn Clements glynn at gclements.plus.com
Tue Jul 31 04:54:19 EDT 2007


Glynn Clements wrote:

> > Sorry, I am a beginner... what shall I do with this gather-circle.c?
> 
> Replace raster/r.neighbors/gather.c with the new file, re-compile,
> install the modified r.neighbors as e.g. r.neighbors.circle.
> 
> If you don't have the source code or can't figure out how to make the
> necessary changes, you'll need to wait until someone integrates it
> into GRASS.

FWIW, I've added a -c flag to r.neighbors to use a circular
neighborhood rather than a square.

I'm unsure as to whether the test should be < or <=. It's currently
<=, but that gives "spikes" (single cells) at the four edges. Using <
would give "flats", and would always omit the outermost row/column of
pixels. Maybe there should be a +0.5 in the distance calculation?

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




More information about the grass-dev mailing list