[gdal-dev] Using SWIG from a Driver

Stefano Moratto stefano.moratto at gmail.com
Thu Feb 23 06:06:53 EST 2012


Hi,

     I think it is possibile using the swig's director feature: Calling
back non c/c++ from c/c++  code.

Basically you have to develop your driver as a C++ class declared in a swig
interface file (.i) declaring virtual functions that have to implements the
features of your driver. This driver should be viewed as an abstract driver.
The "concrete" driver is implemented by a swig generated class that calls
you java code implementing the virtual functions you declared in you ".i
file".

Regards,
Stefano

Dr.Eng. Stefano Moratto
stefano.moratto at gmail.com
stefano.moratto at csiat.it
http://www.csiat.it - Traffic Optimization Software


On Wed, Feb 22, 2012 at 4:13 PM, Even Rouault
<even.rouault at mines-paris.org>wrote:

> Selon Michael Speth <spethm at landcareresearch.co.nz>:
>
> > Greetings GDAL devs,
> >    I am interested in developing a GDAL driver that calls out to a Java
> > library that accesses a database that we are developing using SWIG's
> > Java Bindings.  Are there any examples of existing GDAL drivers using
> > the SWIG bindings?
>
> Not that I am aware of, and not in GDAL source tree for sure.
>
> > If not, how might I use the SWIG library from a new
> > GDAL driver?
> >
> > I've noticed there are 2 usages of Java from a GDAL driver.  Frank
> > pointed out to me (ogr/ogrsf_frmts/ili) and mdb (ogr/ogrsf_frmts/mdb).
> > Both of these driver's use JNI.  The reason I want to use SWIG is to
> > avoid having to deal with the added configuration of JNI (since SWIG
> > handles that already).
>
> I'm not sure if you can call Java code with SWIG. Perhaps, but that's
> perhaps
> more a question for a SWIG mailing list. I don't see how the code of the
> GDAL
> SWIG bindings could help you since you will use a dedicated API for your
> Java
> library.
>
> >
> > Thanks!
> >
> > --
> > Michael Speth
> > Research Systems Developer
> > Landcare Research
> >
> > _______________________________________________
> > gdal-dev mailing list
> > gdal-dev at lists.osgeo.org
> > http://lists.osgeo.org/mailman/listinfo/gdal-dev
> >
>
>
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20120223/88846284/attachment.html


More information about the gdal-dev mailing list