Creating A Sane GDAL Environment (Windows 64 bit) - 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

Java 1.8 JDK x64

Download Java 1.8 from the following page: http://www.oracle.com/technetwork/java/javase/downloads/jre8-downloads-2133155.html. Set your JAVA_HOME Windows environment variable appropriately.

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

The Geospatial Data Abstraction Layer (GDAL) is required in SWAGD for some tiling tasks and reprojection of source imagery files into a projection appropriate for tiling. GDAL is a native C/C++ library and you will need to install it alongside SWAGD.

  1. Download the installer for GDAL 1.11.1 x64 from the GISInternals Support Site. This guide recommends using the stable branch, release 1800 compiled with MSVC 2013.
  2. Run the installer; Using the defaults it will put GDAL on your Windows system in C:\Program Files\GDAL.
  3. Append the GDAL install directory to the Windows PATH environment variable: C:\Program Files\GDAL
  4. Append the SWAGD/RGISuite/lib folder to the Windows PATH environment variable. This will vary depending on where you have cloned the repository on your system.
  5. Add a new Windows environment variable (system-wide) named GDAL_DATA with the value of the directory for SWAGD/RGISuite/lib/data

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 gdal-data folder in the GDAL installation directory (C:\Program Files\GDAL\gdal-data).
  5. Click the new button to make a new environment variable for PATH, and give it the value of the folder where GDAL is installed (C:\Program Files\GDAL).
  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 .dll 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 (C:\Program Files\GDAL in this guide). This folder contains necessary .dll 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 windows 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.