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

Daniele Romagnoli dany.geotools at gmail.com
Sat Aug 5 18:45:11 EDT 2006


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20060806/cee4c74d/attachment.html


More information about the Gdal-dev mailing list