[Gdal-dev] Dataset.BuildOverviews signature in C# bindings

Frank Warmerdam warmerdam at pobox.com
Tue Apr 3 12:39:24 EDT 2007


Jason Beverage wrote:
> All,
> 
> I'm playing with the C# bindings and I noticed that the BuildOverviews
> method in Dataset has the signature:
> 
> int BuildOverviews(string resampling, int overviewlist)
> 
> The C++ signature has many more arguments, and it seems like at the very
> least you have to pass in an array of overview levels instead of just a
> single int for the overviewlist to have the method do anything
> meaningful.
> 
> I would imagine the SWIG files need updating to correct the signature,
> but I'm not sure where the change would need to be made exactly.
> 
> Just wanted to bring this to your attention before the 1.4.1 release if
> its just a quick fix.

Jason,

Please file a bug now, and it might be correctable in time for 1.4.1.

Looking at the generic swig declaration it should at least have the
overview list as an array so perhaps there is a typemapping issue.

   // The (int,int*) arguments are typemapped.  The name of the first argument
   // becomes the kwarg name for it.
%feature("kwargs") BuildOverviews;
%apply (int nList, int* pList) { (int overviewlist, int *pOverviews) };
   int BuildOverviews( const char *resampling = "NEAREST",
                       int overviewlist = 0 , int *pOverviews = 0 ) {
     return GDALBuildOverviews( self, resampling, overviewlist, pOverviews, 0, 
0, 0, 0);
   }
%clear (int overviewlist, int *pOverviews);

The swig bindings don't support the callback interface for progress on this or
other methods with progress callacks (unfortunately).

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    | President OSGeo, http://osgeo.org




More information about the Gdal-dev mailing list