[GRASS-dev] r.resamp.stats method=sum artifacts
Glynn Clements
glynn at gclements.plus.com
Thu Nov 9 02:38:04 EST 2006
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 ...".
--
Glynn Clements <glynn at gclements.plus.com>
More information about the grass-dev
mailing list