macosx: calling 64-bit code through SWIG jni bindings for GIS application
in
Library and Tool Development
•
3 years ago
Hello,
First of all, pardon me because I am a total ignorant when it comes down to Java.
I have been wrestling with trying to get the JAVA SWIG bindings of a very popular GIS data abstraction library (GDAL) to play nicely with Processing. If I can get this to work, I will have read/write access to *many* geospatial formats from within processing.
After compiling GDAL I ended up with the following 64bit SWIG JNI bindings files which I dropped in /Documents/Processing/libraries
I used the following sample code
Questions:
- Is that the error that I am seeing? If so, how do I create a 64-bit build of Processing in MacOSX?
- Will getting a 64 bit build solve my problems?
Thanks!
First of all, pardon me because I am a total ignorant when it comes down to Java.
I have been wrestling with trying to get the JAVA SWIG bindings of a very popular GIS data abstraction library (GDAL) to play nicely with Processing. If I can get this to work, I will have read/write access to *many* geospatial formats from within processing.
After compiling GDAL I ended up with the following 64bit SWIG JNI bindings files which I dropped in /Documents/Processing/libraries
I used the following sample code
- import processing.opengl.*;
import org.gdal.ogr.*;
import org.gdal.gdal.*;
void setup() {
size(640, 360, P3D);
fill(204);
String loadPath = new String("/Library/Python/2.5/site-packages/django/contrib/gis/tests/data/test_poly/test_poly.shp");
if(loadPath == null)
{
println("No file was selected!");
exit();
return;
}
println(loadPath);
String[] arr = {
"--debug", "on"
};
ogr.GeneralCmdLineProcessor(arr); //exception thrown here
}
void draw() {
lights();
background(0);
}
- /Library/Python/2.5/site-packages/django/contrib/gis/tests/data/test_poly/test_poly.shp
Native library load failed.
java.lang.UnsatisfiedLinkError: /Users/rburhum/Documents/Processing/libraries/gdal/library/libogrjni.dylib: no suitable image found. Did find: /Users/rburhum/Documents/Processing/libraries/gdal/library/libogrjni.dylib: mach-o, but wrong architecture
processing.app.debug.RunnerException: UnsatisfiedLinkError: org.gdal.ogr.ogrJNI.GeneralCmdLineProcessor__SWIG_0(Ljava/util/Vector;I)Ljava/util/Vector;
at processing.app.Sketch.placeException(Sketch.java:1543)
at processing.app.debug.Runner.findException(Runner.java:582)
at processing.app.debug.Runner.reportException(Runner.java:558)
at processing.app.debug.Runner.exception(Runner.java:498)
at processing.app.debug.EventThread.exceptionEvent(EventThread.java:367)
at processing.app.debug.EventThread.handleEvent(EventThread.java:255)
at processing.app.debug.EventThread.run(EventThread.java:89)
Exception in thread "Animation Thread" java.lang.UnsatisfiedLinkError: org.gdal.ogr.ogrJNI.GeneralCmdLineProcessor__SWIG_0(Ljava/util/Vector;I)Ljava/util/Vector;
at org.gdal.ogr.ogrJNI.GeneralCmdLineProcessor__SWIG_0(Native Method)
at org.gdal.ogr.ogr.GeneralCmdLineProcessor(ogr.java:137)
at org.gdal.ogr.ogr.GeneralCmdLineProcessor(ogr.java:158)
at org.gdal.ogr.ogr.GeneralCmdLineProcessor(ogr.java:173)
at TestOGL_OGR.setup(TestOGL_OGR.java:50)
at processing.core.PApplet.handleDraw(Unknown Source)
at processing.core.PApplet.run(Unknown Source)
at java.lang.Thread.run(Thread.java:637)
Questions:
- Is that the error that I am seeing? If so, how do I create a 64-bit build of Processing in MacOSX?
- Will getting a 64 bit build solve my problems?
Thanks!
1