[gdal-dev] Availability of Lanczos and cubicspline in gdaladdo

Frank Warmerdam warmerdam at pobox.com
Mon Mar 30 14:56:32 EDT 2009


Benoît Andrieu wrote:
> Hi list !
> 
> I was wondering why the Lanczos and cubicspline are available in 
> gdal_warp and not gdaladdo ?

Benoît,

The overview builder and warper use quite different mechanisms so there
is no close relationship between the resampling options available in each
case.

> The quality after downsizing images with gdalwarp is so perfect that I 
> am now willing to include this in my overviews.
> Is there any chances to have this include in future releases or is there 
> any difficulties I am not aware of ?

It is my intention to add a cubic resampling option to the overview
building for 1.7.  I am not planning to add the other options.

In theory it should be possible to programatically connect warpers to
overview levels in cases where overview band objects have "proper"
dataset parents - which is the case with GeoTIFF hosted overviews.

For instance, this C entry point could likely be used with hSrcDS being
the base datset, and hDstDS being the dataset for the overviews.  One
problem with this plan is that it is likely that overview datasets do
not have proper geotransforms or coordinate systems.  So you might need
to push a geotransform onto the overview dataset (with GDALSetGeoTransform())
before calling GDALReprojectImage().

CPLErr CPL_DLL CPL_STDCALL
GDALReprojectImage( GDALDatasetH hSrcDS, const char *pszSrcWKT,
                     GDALDatasetH hDstDS, const char *pszDstWKT,
                     GDALResampleAlg eResampleAlg, double dfWarpMemoryLimit,
                     double dfMaxError,
                     GDALProgressFunc pfnProgress, void *pProgressArg,
                     GDALWarpOptions *psOptions );

Generally the warp api resamplers are not suitable for with a destination
dataset with a radically lower resolution than the source.  So I'd suggest
doing it such that each overview is generated from the next higher resolution
overview rather than always building from the base level.

Note that the overview levels still need to be pre-created using normal
mechanisms.

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