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

Glynn Clements glynn at gclements.plus.com
Wed Aug 9 19:51:33 EDT 2006


Dylan Beaudette wrote:

> > If you want any other conversion, you have to keep switching regions,
> > so that input maps are read at their native resolution, while output
> > maps are written at the desired resolution.
> 
> Yikes. That does complicate things quite a bit. I wonder if G_get_raster_row() 
> could be modified such that it can perform these three resampling strategies 
> as well. i.e. such that if one wanted a different resampling approach in any 
> function that uses G_get_raster_row(), it would be possible to specify 
> bilinear or cubic convolution... Although this might be a monumental task.

I don't know about "monumental", but it would certainly complicate
matters. Apart from anything else, interpolation requires keeping
multiple rows in memory.

Aside from implementation issues, there are semantic issues, e.g. how
you define the interpolation algorithm near the boundaries of the map
or if adjoining cells are null.

Also, interpolation is only meaningful for scalar quantities, not for
discrete categories, and there's no automatic way to distinguish the
two (at least for CELL maps; floating-point maps should normally
represent scalar quantities, although they could be category maps
which have been processed by a module which uses DCELL throughout for
convenience).

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




More information about the grass-user mailing list