[GRASSLIST:3665] Re: moving window bigger than 25 cells

Glynn Clements glynn.clements at virgin.net
Tue Jun 15 04:10:10 EDT 2004


Carlos Henrique Grohmann wrote:

> > > I need to calculate max, min and mean values within a moving window with 
> > > a window size bigger than 25 cells (which is the upper limit for 
> > > r.neighbors). Does anybod know some advice?
> > 
> > If you have the source code, delete the following line:
> > 
> > 	parm.size->options    = "1,3,5,7,9,11,13,15,17,19,21,23,25" ;
> > 
> > from src/raster/r.neighbors/cmd/main.c, then re-compile and
> > re-install.
> > 
> > I'm fairly sure that there isn't any practical alternative.
> 
> You can convert your data to sites and use s.cellstats. the size of
> the window will be set by your region settings.

That will compute the aggregate over each "tile", which isn't the same
thing as using a moving window.

You could run s.cellstats multiple times, with the region shifted
slightly each time (that may have been what you meant, but it wasn't
clear).

However, for an NxN window, you would need to run s.cellstats NxN
times. A 25x25 window would need 625 runs, and he wants a larger
window than that; I'm not sure whether this would be practical from a
performance standpoint.

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




More information about the grass-user mailing list