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

Charlie Savage cfis at savagexi.com
Sat Aug 5 18:28:23 EDT 2006


Hmm, in theory %apply and OUT do the same thing.  Once again, see:

http://www.swig.org/Doc1.3/Arguments.html#Arguments_nn5

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).

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).

Charlie

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3237 bytes
Desc: S/MIME Cryptographic Signature
Url : http://lists.osgeo.org/pipermail/gdal-dev/attachments/20060805/b761c123/smime.bin


More information about the Gdal-dev mailing list