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

Daniele Romagnoli dany.geotools at gmail.com
Thu Aug 17 03:25:35 EDT 2006


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);
  }
-----------------------------------------------------------------------------------------


On 8/6/06, Daniele Romagnoli <dany.geotools at gmail.com> wrote:
>
>
>
> On 8/6/06, Charlie Savage <cfis at savagexi.com> wrote:
> >
> > Hmm, in theory %apply and OUT do the same thing.  Once again, see:
> >
> > http://www.swig.org/Doc1.3/Arguments.html#Arguments_nn5
>
>
> You are right...
>
> Anyway, I would take the simple approach, which is add this line:
> >
> > %include "typemaps.i"
> >
> > To gdal.i before line 441 which is:
> >
> > %include "Band.i"
> >
> > And in fact, I'd probably put it on line 192 (before the #if
> > defined(SWIGPYTHON).
> >
> > Doing that simplifies the problem.  If it doesn't work, then yes, it
> > appears the OUTPUT * parameter is not working for Java in which case go
> > back to using apply (and maybe submit a bug to SWIG).
>
>
> Unfortunately, it doesn't work :(
> I'll back to using apply...
>
> 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)
>
>
>
> Ok, Thank you. I will add the final %clear directive.
>
> 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).
> >
> > Charlie
> >
> >
> >
> > Thank you very much!
> --
> Best Regards,
> Daniele
>



-- 
Best Regards,
Daniele
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20060817/0686cc08/attachment.html


More information about the Gdal-dev mailing list