Creating A Sane GDAL Environment (Linux x64) - GitHubRGI/swagd GitHub Wiki

Required Software

In order to build and run SWAGD, certain software must exist on the system and proper environment variables must be set. This guide assumes you have already cloned the SWAGD repository somewhere on your system. The following software is needed in addition:

  1. Java 1.8 JDK x64
  2. Eclipse x64 EE (Maven support)
  3. GDAL 1.11.1 x64
  4. Maven 3

Java 1.8 JDK x64

Later versions of Java have not yet been tested.

Eclipse x64 EE (Maven support)

Download the latest version of Eclipse from the following page: http://www.eclipse.org/downloads/. Eclipse Luna EE version was used at the time of this wiki entry.

Other versions of Eclipse will work fine as long as you add the Maven plugin.

GDAL 1.11.1 x64

  1. Download and build GDAL 1.11.1 x64 from source according to these directions.
  2. Set your GDAL_DATA environment variable, pointing to the cloned SWAGD/RGISuite/lib/data directory
  3. Append the location of the gdal shared object (so) files to your PATH variable; These were created in step one and should reside in the base directory for GDAL source code.
  4. Append the SWAGD/RGISuite/lib folder to your PATH variable

Set Eclipse Run/Debug Configurations

In Eclipse, follow these steps to ensure proper environment variables are set:

  1. Go to Run, Debug Configurations
  2. Choose the proper Debug Configuration for RGISuite (running com.rgi.suite.GeoSuite as a Java Application)
  3. Click on the Environment tab
  4. Click the new button to make a new environment variable for GDAL_DATA, and give it a value of the folder where SWAGD/RGISuite/lib/data resides
  5. Click the new button to make a new environment variable for PATH, and give it the value of the folder where SWAGD/RGISuite/lib resides AND ALSO the folder where GDAL is installed.
  6. Ensure the radio button for "Append environment to native environment" is selected.
  7. Click the Apply button then close the window
  8. Restart eclipse to ensure changes have taken effect

Troubleshooting

  • If you receive an Unsatisfied Link error while trying to run/debug SWAGD, this indicates that the folder located at SWAGD/RGISuite/lib is not seen on the PATH variable. This folder should contain a JAR file for GDAL as well as multiple .so files that SWAGD needes to run tiling code.
  • If you receive errors regarding inproper coordinate conversion or missing files when trying to reproject imagery, then this means the GDAL_DATA variable is not properly set.
  • If you recieve an error saying that AutoCreateWarpedVRT return null, this means the GDAL folder is not seen on the path variable. This folder contains necessary .so files for the GDAL JAR to perform correctly.
  • Whenever you make environment/path changes in either Eclipse or on the Windows system, be sure to close all relevant applications before attempting to run/debug again. When in doubt, just restart the system.
  • If receiving a Jacoco error that states "Plugin execution not covered by lifecycle configuration" in eclipse, go to Window->Preferences->Maven->Errors/Warnings, and change the default value for "Plugin execution not covered by lifecycle configuration" to Ignore.