Using Geospacial Import/Export java tools

Tools
Enthusiast

Using Geospacial Import/Export java tools

I hope this is the right forum for this question. I am working through the Orange book(Teradata Spatial Release 13.0 Users Guide) on this and am stumped with the example code on page 25, likely because it's been a while since I've done java on a windows system...

::My Code in a window batch file...
java ^
-classpath .^
;c:\pathtopkg\bin^
;c:\pathtopkg\bin\geojni.dll^
;c:\pathtopkg\bin\terajdbc4.jar^
;c:\pathtopkg\bin\tdgssjava.jar^
;c:\pathtopkg\bin\tdgssconfig.jar ^
com.teradata.geo.TDGeoExport ^
-l 192.168.47.128/dbc,dbc ^
-f c:\pathtopkg\bin\epsg_data\coordinate_axis.csv

The output I got was a linking issue with a component of the library i suspect that adding geojni.dll is overkill or just wrong, but I get the same response with or without it there. Basically it can't find it...


::Result output the dll exists in the bin directory and the class is in the com/teradata/geo directory. (lines broken up for easy reading...)
C:\pwd>java -classpath .
;c:\pathtopkg\bin
;c:\pathtopkg\bin\geojni.dll
;c:\pathtopkg\bin\terajdbc4.jar
;c:\pathtopkg\bin\tdgssjava.jar
;c:\pathtopkg\bin\tdgssconfig.jar
com.teradata.geo.TDGeoExport
-l 192.168.47.128/dbc,dbc
-f c:\pathtopkg\bin\epsg_data\coordinate_axis.csv
java.lang.UnsatisfiedLinkError: no geojni in java.library.path
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
at com.teradata.geo.TDGeoExport.main(TDGeoExport.java:701)
===========================================
Data exporting failed!


4 REPLIES
Enthusiast

Re: Using Geospacial Import/Export java tools

Addendum, I've thrown the tool into the SLES TD14 VM Express and I get much the same problem:

TDExpress14.0_Sles10:~/td-GeoImportExport-1-6/bin # java -classpath ./*.* com.teradata.geo.TDGeoImport
Exception in thread "main" java.lang.NoClassDefFoundError: //geojni/dll
Caused by: java.lang.ClassNotFoundException: ..geojni.dll
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
Could not find the main class: ./geojni.dll. Program will exit.
Enthusiast

Re: Using Geospacial Import/Export java tools

Okay it seems I needed to add the JVM flags and per the runit.txt file in the V1.6 download. 

java -Xms256m -Xmx512m -classpath .;tdgssconfig.jar;terajdbc4.jar com.teradata.geo.TDGeoImport -l geo_system/geo_user,geo_pw -s mydb -f c:\data\demo\load -n co99_d00

unfortunately however it didn't make it because it won't allow this 32 bit binary on a 64 bit system. So I'm not able to continue on my 64bit laptop. Strange...

C:\Users\RB186032\Downloads\td14\td-GeoImportExport-1-6\bin>java -Xms256m -Xmx512m -classpath .;tdgssconfig.jar;terajdbc4.jar com.teradata.geo.TDGeoImport -l geo_system/geo_user,geo_pw -s mydb -f c:\data\demo\load -n co99_d00
java.lang.UnsatisfiedLinkError: C:\Users\RB186032\Downloads\td14\td-GeoImportExp
ort-1-6\bin\geojni.dll: Can't load IA 32-bit .dll on a AMD 64-bit platform
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary1(Unknown Source)
at java.lang.ClassLoader.loadLibrary0(Unknown Source)
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
at com.teradata.geo.TDGeoImport.main(TDGeoImport.java:1149)
===========================================
Data importing failed!
Enthusiast

Re: Using Geospacial Import/Export java tools

Rupert, did you figure out the issue?  I have run into the same error.  Please provide an update if you were able to resolve it.

Enthusiast

Re: Using Geospacial Import/Export java tools

I am also facing the same issue. 

Can't laod IA 32-bit .dll on a AMD 64-bit platform.

The error is related geojni.dll when it is linking.....

Any idea how to fix this?

Is there a 64 bit vrsion of this file???

Thanks in advance for any help on this.