[GRASS-user] r.average issue with rasters at different resolutions

Hi all,

I have an issue with the module r.average. I'm testing the module with a constant cover map so that I know the result I should get, but the output map has a different value. I have this problem only when I use a cover map and a base map with different resolutions.

Does anybody know how to fix this problem?

Thank you in advance,
Matteo

Matteo,

···

On Sat, Oct 19, 2013 at 3:31 PM, matteo poletti <pollo1_91@yahoo.it> wrote:

Hi all,

I have an issue with the module r.average. I’m testing the module with a constant cover map so that I know the result I should get, but the output map has a different value. I have this problem only when I use a cover map and a base map with different resolutions.

Does anybody know how to fix this problem?

This is not a problem of the grass module. Which kind of map is the base map? If you compare the average you get from 2 base maps at different resolutions, you probably will get two different values. Particularly, if for example your map is slope, the higher is the cell size, the smaller will be the average slope.

HTH

Best regards,

Dr. Margherita DI LEO
Scientific / technical project officer

European Commission - DG JRC
Institute for Environment and Sustainability (IES)
Via Fermi, 2749
I-21027 Ispra (VA) - Italy - TP 261

Tel. +39 0332 78 3600
margherita.di-leo@jrc.ec.europa.eu

Disclaimer: The views expressed are purely those of the writer and may not in any circumstance be regarded as stating an official position of the European Commission.

Hi Margherita,

Thank you for your reply!

Da: Margherita Di Leo <diregola@gmail.com>
Which kind of map is the base map?

Well, shouldn't be the base map just a raster map which assigns the same category to the cells that should be averaged together?

If you compare the average you get from 2 base maps at different resolutions, you probably will get two different values.

I'm sorry but I don't get the point. The base map I use is always at the same resolution (res=0.2), which is also the resolution of the region. My problem is that I have a cover map with with a different resolution (res=200) and if I use it as it is I get wrong result. The workaround I found is to change the resolution of the cover map before running r.average (r.mapcalc "rescaled_cover_map=original_cover_map") but it's ugly.

Maybe I'm missing something,
Thanks!

Matteo

On Sat, Oct 19, 2013 at 5:20 PM, matteo poletti <pollo1_91@yahoo.it> wrote:

Hi Margherita,

Thank you for your reply!

Da: Margherita Di Leo <diregola@gmail.com>
Which kind of map is the base map?

Well, shouldn't be the base map just a raster map which assigns the same category to the cells that should be averaged together?

If you compare the average you get from 2 base maps at different resolutions, you probably will get two different values.

I'm sorry but I don't get the point.

In the case of different resolutions GRASS performs resampling on the
fly which is nearest neighbor resampling.
It is usually better to do that in a user controlled way, i.e. prepare
the maps properly beforehand.

The base map I use is always at the same resolution (res=0.2), which is also the resolution of the region. My problem is that I have a cover map with with a different resolution (res=200) and if I use it as it is I get wrong result. The workaround I found is to change the resolution of the cover map before running r.average (r.mapcalc "rescaled_cover_map=original_cover_map") but it's ugly.

Right. Please see
http://grasswiki.osgeo.org/wiki/Interpolation#Reinterpolation_of_.22filled.22_raster_maps_.28continuous_data.29_to_a_different_resolution
-> Resampling of raster maps to finer resolution

for better ways.

Best
Markus