I have the following setup:
- GDAL library with Python bindings (SWIG)
- Some glue code (Python)
- A C library, interfaced with ctypes
I want to pass the underlying dataset pointer/handle of the SWIG Dataset object to my C library. How can I retrieve this pointer?
I do not want to interface the C library with SWIG.
It was actually quite easy, and I hope that my solution is portable. Given, that my C function definition looks somewhat like this:
Then my
ctypesdefinition is like this:And I can call the C function with: