[gdal-dev] resampling techniques in GDAL

Frank Warmerdam warmerdam at pobox.com
Tue Jun 16 19:03:48 EDT 2009


Gregory, Matthew wrote:
> Hi all,
> 
> A recent post got me thinking about resampling techniques.  I've posted
> a graphic to help illustrate my question.  
> 
>   http://www.fsl.orst.edu/lemma/sandbox/resample.png
> 
> In the graphic, assume the input image is the 3x3 grid with black
> outlines and blue and yellow dot centers.  Assume the red outlined
> pixels represent three different output resolutions of a single pixel
> each having its center at the black dot.  
> 
> Using bilinear interpolation, each of these three output resolutions get
> the same value (tested using gdalwarp) based on the four yellow cell
> centers.  I understand why this is happening and realize this is the
> expected behavior.  
> 
> My question, however, is whether or not there is a resampling technique
> (inside or outside GDAL) that uses the proportional weights and values
> of *all* input pixels touched by the output pixel.  At the finest
> resolution in the illustration, this would be equivalent a nearest
> neighbor resampling (ie. the output pixel is wholly contained within the
> input pixel) and at the coarsest resolution, all nine input pixels would
> contribute to the output value based on proportional area.  

Matt,

In a loose sense this is how averaged overviews works, and it is part of
why they are suitable for radically downsampling while the at most 4x4
resampling kernels in gdalwarp are not suitable for radical downsampling.

The current gdalwarp infrastructure does not make it easy to do what
you want - particularly when faced with transformations that are
non-linear.  If we took the narrower case of simple downsampling we
could design various options like what you want - possible based on
the template of the averaged overviews.

However, I have no plans to pursue this myself.

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent



More information about the gdal-dev mailing list