[GRASSLIST:581] Re: Change of spatial support

Ulrich Leopold uleopold at science.uva.nl
Wed Apr 5 09:43:57 EDT 2006


On Wed, April 5, 2006 13:03, Hamish wrote:
>> I am trying to change the spatial support (grid size) of some floating
>> point raster maps from 250x250m to 1000x1000m. It's a kind of
>> upscaling or more preciseley aggregation.
>>
>> All I need to do is to superimpose the larger grid on the smaller grid
>> and compute the average and variance for the larger grid from the 4x4
>> 250m cells located within one 1000m cell.
>>
>> I recognise that this is still not possible in GRASS. The GRASS
>> resampling methods for change of resolution, such as r.neigbors or
>> g.region are not an option as they do not provide a simple averaging
>> method and the aggregation error (variance).
>
>
> r.resample, r.resamp.rst
>
> ?
> Hamish
>
>
No r.resample uses the same method also nearest the neighbor method and does
not provide any calculation of summary statsitics within a larger grid cells.


r.resamp.rst does a re-interpolation of the raster cells. I am  looking for an
aggregation of floating point raster cells for a lower grid resolution (4x4 =>
1x1). Simply take the average of a 4 x 4 raster cells and produce a single
mean value for a larger grid cell (but for floating point numbers not
integers).

Take 4 x 4 raster cells

2.5  3.5  1.5  0.5
2.5  3.5  1.5  0.5
2.5  3.5  1.5  0.5
2.5  3.5  1.5  0.5

compute the mean and variance to yield one raster cell with

mean = 2.0
var  = 1.333

jump to next block of 4 x 4 raster cells which have not been used in previous
calculation and repeat the calculation and so on.


Any ideas for r.mapcalc?




More information about the grass-user mailing list