Greetings:
Referencing this blog post http://erouault.blogspot.com/2015/10/gdal-and-ogr-utilities-as-library.html I need to use the "new" Translate method in the GDAL Java API. However, the Translate method is not even in GDAL2.1.0 available at Maven (TranslateOptions is in there, but not Translate). The Windoze versions of GDAL available at GISInternals also do not seem to have the Translate method, although I did find one version that has it, I've added it to an IntelliJ project as a library.
 
Question1: Is it "supposed" to be available at this time?
 
There is little/no documentation on how to use the Translate method. I'm guessing here, but the way I'm trying to use it is:
 
Vector<String> optionsVector = new Vector<>();
optionsVector.add("of PNG");
optionsVector.add("outsize 128 128");
TranslateOptions options = new TranslateOptions(optionsVector);

Dataset dst = org.gdal.gdal.gdal.Translate("b:/temp/translateTest.png", ds, options);
 
The input dataset (ds) is a GeoTiff, I'm just trying to create a .png thumbnail. The call to Translate does indeed write a translateTest.png file to disk, but it's just the original geotiff - renamed, not a .png, and not re-sized.
I do not know what the "arguments" in the optionsVector are supposed to be (It does throw an exception if I put in -of PNG, it doesn't like the hyphen), and I've also tried "one per add" (.add("of"), .add("PNG"))
 
Question2: If this thing is supposed to be ready for prime-time, what is the TranslateOptions object supposed to contain?  What is the correct way to populate it and what are valid "arguments"?
 
Help/advice appreciated.
_______________________________________________
gdal-dev mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/gdal-dev

Reply via email to