[GRASS-user] Raster aggregation with r.neighbors

Colin McClean cjm8 at york.ac.uk
Fri Jan 26 11:38:45 EST 2007


Patrick

Something like this should work:

Make a layer with unique numbers for your 5 km cells.
g.region res=1 km
r.statistics base=unique_5km_layer cover=1km_layer method=average(but 
you could used median,sum,min,max,etc) output=outputgrid
g.region res=5km
r.mapcalc "output5km = @outputgrid"

Cheers
Colin


Patrick Meyfroidt wrote:

> Hello,
>
> I'm working with grass 6.2.1 and I'm looking for a way to aggregate a 
> raster (downscale the resolution from 1km to 5km by calculating the 
> average of values over a 5x5 pixels window). It seems that 
> *r.resamp.stats* is designed for that, but it is not in version 6.2.1
> So I used *r.neighbors* like that:
>
> > g.region res=5000
> > r.neighbors -a input=xxx output=xxx method=average size=5
>
> In the archive I found that:
> http://grass.itc.it/pipermail/grassuser/2002-September/007417.html
> but using the -a option seemed to solve the problem of output resolution.
>
> Can anyone tell me if this method could be problematic in some way, or 
> provide less performant results than r.resample.stats?
>
> Thank you,
>
> Patrick Meyfroidt
>
> Research assistant
> Laboratory of Land Change and Remote Sensing
> Department of Geography
> University of Louvain
> Place Louis Pasteur, 3
> B - 1348 Louvain-La-Neuve
> Belgium
> Email: meyfroidt at geog.ucl.ac.be
> http://www.geo.ucl.ac.be/Recherche/Teledetection/index.html
>
>------------------------------------------------------------------------
>
>_______________________________________________
>grassuser mailing list
>grassuser at grass.itc.it
>http://grass.itc.it/mailman/listinfo/grassuser
>  
>


-- 
----------------------------------------------
Dr Colin McClean
Environment Department
University of York
Heslington
York YO10 5DD
Tel: +44-(0)1904-432995
Fax: +44-(0)1904-432998
http://www.york.ac.uk/environment/
-----------------------------------------------





More information about the grass-user mailing list