[Gdal-dev] Re: Fwd: gdal swig interface Band.i Updated

Daniele Romagnoli dany.geotools at gmail.com
Thu Aug 17 10:47:43 EDT 2006


Dear Mr. Warmerdam,
Thank you for the update.

I quote here an useful comment of Mr. Charlie Savage.

Mr. Charlie Savage wrote:
.....
--------------------------------------------------------------------------------------------------------
However, if you use %apply then you should also clear it after the
method is defined.

%apply (int *OUTPUT){int *blockXSize, int *blockYSize}
  void GetBlockSize(int *blockXSize, int *blockYSize){
              GDALGetBlockSize(self, blockXSize, blockYSize);
  }
%clear (int *blockXSize, int *blockYSize);

Its probably not that important in this case, but if there happened to
be another method with the same 2 output parameters then this typemap
would be applied again (sometimes you want that, sometimes you don't).
--------------------------------------------------------------------------------------------------------



Best regards,
Daniele

On 8/17/06, Frank Warmerdam <warmerdam at pobox.com> wrote:
>
> Daniele Romagnoli wrote:
> > Dear Mr Warmerdam,
> > Could you please update the Band.i interface resulting from our
> > discussions (between me, you and Mr. Charlie Savage)?
> >
> > The section which needs to be updated is:
> >
> -----------------------------------------------------------------------------------------
> >
> > %apply (int *OUTPUT){int *blockXSize, int *blockYSize}
> >    void GetBlockSize(int *blockXSize, int *blockYSize){
> >                GDALGetBlockSize(self, blockXSize, blockYSize);
> >    }
> > %clear (int *blockXSize, int *blockYSize);
> >
> -----------------------------------------------------------------------------------------
> >
> > instead of the actual version:
> >
> ----------------------------------------------------------------------------------------
> >
> > void GetBlockSize(int *OUTPUT, int *OUTPUT){
> >               GDALGetBlockSize(self, blockXSize, blockYSize);
> >   }
> >
> -----------------------------------------------------------------------------------------
>
> Daniele,
>
> A night or two ago I noticed things weren't even building with the old
> setup (since the name OUTPUT was used twice I suppose), so I changed it to
> this:
>
> %apply (int *OUTPUT){int *pnBlockXSize, int *pnBlockYSize}
>
>    void GetBlockSize(int *pnBlockXSize, int *pnBlockYSize) {
>        GDALGetBlockSize(self, pnBlockXSize, pnBlockYSize);
>    }
>
> Things now at least build, though the test suite does not use this
> method.  I'd appreciate your verifying that this is working.
>
> I apologize for not dealing with this sooner.  I kind of got lost in
> the exchange between you and Charlie.
>
> 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 OSGF, http://osgeo.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20060817/7ffdc8be/attachment.html


More information about the Gdal-dev mailing list