[GRASS-user] integration of sample.c algorithms into r.resample

Dylan Beaudette dylan.beaudette at gmail.com
Wed Aug 9 14:54:52 EDT 2006


On Wednesday 09 August 2006 11:47, Dylan Beaudette wrote:
> Hi,
>
> I suppose that this is more for the developers...
>
> I was thinking about integrating the 3 re-sampling algorithms (defined in
> lib/gis/sample.c) into the current r.resample command. It is my
> understanding that r.resample will currently only use the nearest neighbor
> algorithm.
>
> would anyone else be interested in the addition of bilinear and cubic
> convolution resampling to r.resample ?
>
> PS: all that this will require is a bit of re-tooling in r.resmaple/main.c
> such that it calls G_get_raster_sample() at each cell in  the input map.
>
> PSS: thanks to Markus for moving these algorithms out of v.sample, and into
> a library style format.
>
>
> Cheers,

A quick follow-up:

in the source for r.resample, it looks like the resampling is done in this 
loop:

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);
	}


...via the NN style resampling associated with converting between regions of 
differing resolution.. (?)

Is this a correct interpretation?

thanks,

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




More information about the grass-user mailing list