[GRASS-user] r.mapcalc on rasters with different resolutions and origin

Dear list,

I would like to use r.mapcalc in order to compare 2 different resolution floating-point raster (A = 1km and B = 100 m) and to calculate some statistics on the finest resolution map ( so g.region res=100)

As the two layers have different resolution and origin, some doubts arise :

does r.mapcalc use nearest neighbour to perform calculation?
is a resample using r.resamp.interp (bilinear or cubist) suggested/needed before running r.mapcalc?

arcgis manual about map argebra says:
"For the floating-point input rasters of different resolution it is recommended to RESAMPLE all the data using BILINEAR interpolation or CUBIC convolution before running Merge. Otherwise, the Merge function will automatically resample the rasters using NEAREST neighbor (which is not appropriate for the continuous type of data)

I was not able to find this kind of recommendation in mapcalc help or wiki page … Am I missing something?

thanks

Enrico

Enrico Gallo wrote:

I would like to use r.mapcalc in order to compare 2 different resolution
floating-point raster (A = 1km and B = 100 m) and to calculate some
statistics on the finest resolution map ( so g.region res=100)

As the two layers have different resolution and origin, some doubts arise :

does r.mapcalc use *nearest neighbour* to perform calculation?

The GRASS libraries use nearest-neighbour to resample raster maps to
the current region. This affects any module which doesn't specifically
change the region (and r.mapcalc doesn't),

[The r.resamp.* modules *do* change the region to match the input.]

is a resample using *r.resamp.interp* (bilinear or cubist) suggested/needed
before running r.mapcalc?

That depends upon the nature of the data. Ask yourself: if r.mapcalc
insisted that all inputs had the same resolution and alignment, how
would you perform resampling? If you would use nearest-neighbour, then
you don't need to manually resample, otherwise you do.

--
Glynn Clements <glynn@gclements.plus.com>