[GRASS-dev] r.resamp.stats method=sum artifacts

Dylan Beaudette dylan.beaudette at gmail.com
Fri Nov 3 13:48:19 EST 2006

On Thursday 02 November 2006 17:03, Glynn Clements wrote:
> Markus Neteler wrote:
> > >> I've added r.resamp.stats and r.resamp.interp to the GUI menus.
> > >> (Raster->Devel)
> > >>
> > >> should r.resample be tagged for future removal? (same result as with:
> > >> 'r.resamp.interp method=nearest' ???).
> > >
> > > No.
> > >
> > > r.resample uses libgis' built-in resampling, so it is guaranteed to
> > > resample in an identical manner to other commands.
> > >
> > > "r.resamp.interp method=nearest" performs the resampling itself, so it
> > > could produce slightly different results due to rounding errors. The
> > > method=nearest option was only included for completeness; if you want
> > > nearest-neighbour resampling, r.resample is preferred.
> >
> > Honestly, this sounds confusing to me. Having NN method twice which
> > produces slightly different results, is hard to explain to users.
> It's largely inevitable.
> Even if r.resample is removed, it can (mostly) be duplicated with e.g.
> "r.mapcalc dst = src", which also isn't guaranteed to produce the same
> results as r.resamp.interp. Similarly for any other module which can
> be made to perform a "copy" operation by some setting of its
> parameters (r.mfilter with a 1x1 kernel, maybe?).
> I could remove method=nearest from r.resamp.interp, but if it's ever
> extended to support more advanced interpolation schemes with
> parameters, the same issue could arise.
> Ultimately, nearest-neighbour resampling will always have boundary
> cases where the centre of an output cell falls on the boundary between
> two or four input cells. In that situation, the end result will depend
> upon everything which can affect the rounding error: the algorithm
> used, the compiler, the compilation switches, the architecture, etc.

This is deviating someone from the NN issues... but:

I have been noticing some odd edge effects when using r.resamp.stats 
method=mode .... i.e. i am getting a "ring" of cells with 0-value around the 
actual data. Within the "ring" the results appear to match those obtained 
with an alternate raster-vector-starspan-raster approach to doing the same 

a graphical summary can be found here:

Details on the raster-vector-raster approach are listed here:

Dylan Beaudette
Soils and Biogeochemistry Graduate Group
University of California at Davis

More information about the grass-dev mailing list