How can I execute gdal_translate in Java? For example, will something like this work?

gdal_translate "PG:host=localhost dbname='xyzy' schema=public' table='xyz'" "d:\xyx\ab.tiff"

1 Answer 1


Check the quotes and gdal_translate expression

// Execute command
String gdal_translate="gdal_translate "+"PG:host=localhost dbname='xyzy'                      schema=public' table='xyz'"+"d:\xyx\ab.tiff"";
String command0 = "cmd /c start /min /wait "+gdal_translate;
Process child0 = Runtime.getRuntime().exec(command0);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.