[gdal-dev] GDAL and OGR utilities as library functions?

Even Rouault even.rouault at spatialys.com
Tue Jan 3 10:48:31 PST 2017


On mardi 3 janvier 2017 20:45:58 CET Vladimir Sandoval wrote:
> 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?

To be honest, I didn't try but it looks like the method is available :

http://gdal.org/java/org/gdal/gdal/gdal.html#Translate(java.lang.String,%20org.gdal.gdal.Dataset,%20org.gdal.gdal.TranslateOptions)

and I can see it in the generated .java files from swig files.

>  
> There is little/no documentation on how to use the Translate method.

(Contributions in 2017 are as welcome as in previous years ! Hint: the file to edit is swig/java/javadoc.java and
the the doc is built with swig/java/make_doc.sh)

The general principles are exposed
here https://trac.osgeo.org/gdal/wiki/rfc59.1_utilities_as_a_library and should be
transposable to other languages.

> 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");

try

optionsVector.add("-of");
optionsVector.add("PNG");
optionsVector.add("-outsize");
optionsVector.add("128");
optionsVector.add("128");

Even


-- 
Spatialys - Geospatial professional services
http://www.spatialys.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20170103/7a582fdc/attachment.html>


More information about the gdal-dev mailing list