[GRASSLIST:1095] Re: Reproject raster data - weighted average

David Orme d.orme at imperial.ac.uk
Wed Sep 3 05:38:25 EDT 2003


Hi,

Providing more information... I need to transform some global data sets 
in geographic resolutions, for example quarter degree, into a 
cylindrical equal area grid. The resolution of the CEA location has 
been chosen so that it matches the geographic resolution of the data 
set at the latitude of true scale - as a result the longitudinal 
divisions of the two grids coincide but the latitudinal lines divisions 
differ (except at the equator - the origin of both grids). What I would 
like to be able to do is to calculate the values of the new grid as an 
average of the original cells underlying each new cell weighted by 
their contribution to the area of the new cell. As a toy example, say I 
have three cells going north from the equator with values 5, 7, 8 and 
the new grid happens to form two cells with a division half way through 
the second cell. The first cell in the new grid should contain the mean 
of 5 and 7 weighted by 1 and 0.5 (i.e. 5.6667) - the second the 
weighted mean of 7 and 8 weighted by 0.5 and 1 (7.6667).

Paul and Rado (thanks for the amazingly fast replies!) suggested:

1) Interpolation from a point surface - I think this would give the 
correct answer if the interpolation neighbourhood was set up correctly. 
Unfortunately because I'm going to an equal area grid, the 
neighbourhood for cells in the new grid varies with latitude.

2) r.neighbours - again I think this would give the correct answer 
locally but because the CEA and geographic grids do not overlie each 
other in a regular fashion it won't work beyond that, unless there is a 
way of feeding a grid with varying North South resolution into 
r.neighbours, which I seriously doubt.

I can think of a way of doing it using a transformation matrix in R, 
for instance, but I wondered if I was reinventing the wheel.

Thanks,
David




More information about the grass-user mailing list