[Gdal-dev] GDAL swig - allregister()

Norman Barker nbarker at ittvis.com
Wed Jul 19 08:51:21 EDT 2006


Hi,

This is such a minor change, but is it possible to add
gdal.AllRegister() in swig gdal_java.i

%pragma(java) jniclasscode=%{
  private static boolean available = false;

  static {
    try {
      System.loadLibrary("gdaljni");
      gdal.AllRegister();
      available = true;
    } catch (UnsatisfiedLinkError e) {
      available = false;
      System.err.println("Native library load failed.");
      System.err.println(e);
    }
  }
  
  public static boolean isAvailable() {
    return available;
  }
%}

This makes it possible to call gdal from multiple java threads.

Thanks,

Norman




More information about the Gdal-dev mailing list