Does anyone know a quick way to use GDAL Java Bindings in Java Eclipse?
It should be GDAL > 2.0.0 in order to support KEA datatypes. GDAL-Java from OSGEO4W seems to be obsolete.
I am working on Windows 10 on a 64Bit processor and Eclipse Mars.
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It only takes a minute to sign up.Sign up to join this community
Setting up GDAL for Java IDE (in Windows) requires the following two steps:
Setting GDAL in system/server using the following steps.
You can download the executable GDAL packages (stable releases) from GIS internals. Choose compiler (Microsoft Visual C) & architecture (32bit or 64bit) depending upon your PC and download the compiled binaries zip file (not the Compiled libraries and headers).
Extract the zip file and save in some drive preferably C drive.
Now create/append the following data in your PC Environmental Variables (Computer --> Properties -->Advance System Settings -->Environment variables):
CREATE/APPEND VARIABLE VALUE REQUIREMENT
CREATE GDAL_DATA C:\gdal\bin\gdal-data MANDATORY CREATE GDAL_DRIVER_PATH C:\gdal\bin\gdal\plugins MANDATORY APPEND PATH C:\gdal\bin MANDATORY APPEND PATH C:\gdal\bin\gdal\apps OPTIONAL
Setting GDAL for project in Netbeans/Eclipse IDE.
Copy and paste following four/one dll file(s) from C:\gdal\bin\gdal\java to your jdk bin folder.
gdalconstjni.dll gdaljni.dll ogrjni.dll osrjni.dll
gdalalljni.dll (in higher versions of gdal v2.3.0 and above)
You need to add gdal.jar file (from C:\gdal\bin\gdal\java) in the JAVA BUILD PATH Library location.
Note: If you forget to do this you get an exception while executing your code as Exception in thread "main" java.lang.UnsatisfiedLinkError.
Note: For more information on gdal java projects, visit GeoSpatial Blogs