[gdal-dev] SWIG JNI binding question with GetMetadataItem function
even.rouault at mines-paris.org
Thu Aug 11 14:08:17 EDT 2011
> I've found a thread discussing a similar issue under the android-ndk
> group, but without the swig component:
> I infer from that discussion that either the GDAL interface definition
> file needs to be tweaked or I need to use javah instead of swig.
No, I don't think you need to tweak anything in the swig generated files. If
there was an error, it would not work in the standard (non-Android) case too.
And I verified it works just fine.
I'm not sure how you've compiled the gdal_warp.cpp, but if you didn't use the
provided swig/java/GNUmakefile, there's one point you must be very careful that
is mentionned at the bottom of that makefile :
# Do not remove -fno-strict-aliasing while SWIG generates weird code in upcast
# See http://trac.osgeo.org/gdal/changeset/16006
That would be a plausible cause for the crash, since in your particular case
the GetMetadataItem() method is in the MajorObject class, so the Dataset
object needs to call the SWIGDatasetUpcast() method...
> I'm still new to all of this (including GDAL) so assume I'm missing
> something blatantly obvious.
> Thanks for any help,
> Jim P.
More information about the gdal-dev