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

Dylan Beaudette dylan.beaudette at gmail.com
Thu Nov 9 20:46:51 EST 2006

On Wednesday 08 November 2006 23:38, Glynn Clements wrote:
> Hamish wrote:
> > I asked earlier if r.resample should be retired, the answer was
> > "no, keep it" as `r.resamp.interp method=nearest` isn't guaranteed to
> > give exactly the same result. (but `r.mapcalc new=old` will match
> > r.resample?)
> Just about any r.* command which has a "copy mode" (i.e. some set of
> arguments which results in the output being equal to the input) will
> behave like r.resample. The core of r.resample is:
> 	for (row = 0; row < nrows; row++)
> 	{
> 		if (verbose)
> 			G_percent (row, nrows, 2);
> 		if (G_get_raster_row (infd, rast, row, data_type) < 0)
> 			exit(1);
> 		if (G_put_raster_row (outfd, rast, out_type) < 0)
> 			exit(1);
> 		G_mark_raster_cats (rast, ncols, &cats, data_type);
> 	}
> [Literal cut-and-paste from raster/r.resample/main.c]
> IOW, it's a get-row/put-row loop, which relies upon the automatic
> resampling performed by G_get_raster_row() etc. Any GRASS module which
> reads a raster map using the current region will have the map
> resampled in exactly the same way.
> > how about this one:
> >
> > Should r.bilinear be tagged for retirement after GRASS 6.x?
> >   (due to `r.resamp.interp method=bilinear`)
> Yes.
> Or replaced by a script which prints a "this module is deprecated"
> warning then runs "r.resamp.interp method=bilinear ...".

I think that this last option is a good migration path to a more coherent set 
of resampling modules.

Thanks again Glynn for setting these up. However, I have noticed odd behavior 
with r.resample.stats when the native resolution == the current resolution: 
i.e. there is no difference in start/final cell size. I will start a new 
thread on this topic.


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

More information about the grass-dev mailing list