Introduction

This is a documentation page for the GDAL API. We are offering our APIs in a variety of programing languages. You can use the SDKs to execute the gdal commands remotely Be sure to change the URL to the url of your installation.

If you need assistance, please raise a support ticket and we are here to assist.


GDAL_API api = new GDAL_API(API_URL, API_KEY);

String response = api.upload(file);

String response = api.execute("gdal_translate -of PDF cdn.png test.pdf", "C:\\path\\to\\destination\\folder\\");


api = GDAL_API(API_URL, API_KEY)

response = api.upload("C:\\path\\to\\imput\\file\\name.extension")

response = api.execute("gdal_translate -of PDF cdn.png my.pdf", "C:\\path\\to\\output\\folder");


$api = new GDAL_API(API_URL, API_KEY);

$response = $api->upload($filePath);

$response = $api->execute("gdal_translate -of PDF cdn.png my.pdf", realpath("./"));


var api = new GDAL_API("http://185.43.108.36", "Gsqudasasdaa5ZJiRs6_X4HwNaU_af0bhGDCch");

api.upload('C:\\path\\to\\file\\name.extension', function(response) {
	console.log(response);
});

api.execute('gdal_translate -of PDF 3.png muaaz.pdf', 'C:\\Path\\to\\save\\file\\', function(response) {
	console.log(response);
});


GDAL_API api = new GDAL_API("http://185.43.108.36", "Gsquda5ZJasdasiRs6_X4HwNaU_af0bhGDCch");

String response = api.upload("C:\\Path\\To\\File\\Name.Extension");

String response = api.execute("gdal_translate -of PDF cdn.png test.pdf", "C:\\Path\\To\\The\\OutPut\\Directory\\");

Upload File to Server/CDN

This is the first step. If your command needs an input file then the file must be uploaded before the command execute. This step is optional in case you dont want to add any input file rather wants to provide a database as input

Input Data

file:
String Complete File Path

Output Data (JSON)

success:
Boolean Indicate Upload status true/false
* message:
String Error detail if success is false.
** cdn_path:
String A CDN URL to the file.


* : will not be available if the success if TRUE
** : will not be available if the success if FALSE


File file = new File("C:\\complete\\path\\to\\source\\file");
try {
	String response = api.upload(file);
	
	System.out.println(response); // Parse the json response
} catch (Exception e) {
	System.out.println(e.getMessage());
}


try:
	response = api.upload("C:\\path\\to\\imput\\file\\name.extension")
	print response
except Exception, e:
	print e


try {
	$response = $api->upload($filePath);
	print_r($response);
} catch (Exception $e) {
	echo $e->getMessage();
}


try {
	api.upload('C:\\path\\to\\file\\name.extension', function(response) {
		console.log(response);
	});
} catch (e) {
	console.log(e.message)
}


try {
	String response = api.upload("C:\\Path\\To\\File\\Name.Extension");
	Console.WriteLine(response);
}
catch(Exception e) {
	Console.WriteLine(e.Message);
}

GDAL Execute Command

The Second Step is Required to execute the GDAL command.
NOTE: Input File Name should be same that you uploaded

Input Data

command:
String GDAL Command to execute
local_file_path (Optional):
String Path to save output file

Output Data (json)

success:
Boolean Indicate Execution Status true/false
*** message:
String Failed reason
**** output_file_name:
String Name of output file
**** cdn_path:
String A CDN URL to the file
raw_output:
String Raw Output Data from the shell command.


*** : will be available only on error. and the rest of the keys will not be available
**** : these keys will not be available if there is no output file available


try {
	String response = api.execute("gdal_translate -of PDF cdn.png test.pdf", "C:\\path\\to\\destination\\folder\\");
	System.out.println(response);
} catch (Exception e) {
	System.out.println(e.getMessage());
}


try:
	response = api.execute("gdal_translate -of PDF cdn.png my.pdf", "C:\\path\\to\\output\\folder");
	print response
except Exception, e:
	print e


try {
	$response = $api->execute("gdal_translate -of PDF cdn.png my.pdf", realpath("./"));
	echo "
"; print_r($response); } catch (Exception $e) { echo $e->getMessage(); }
try { api.execute('gdal_translate -of PDF 3.png muaaz.pdf', 'C:\\Path\\to\\save\\file\\', function(response) { console.log(response); }); } catch (e) { console.log(e.message) } try { String response = api.execute("gdal_translate -of PDF cdn.png test.pdf", "C:\\Path\\To\\The\\OutPut\\Directory\\"); Console.WriteLine(response); } catch (Exception e) { Console.WriteLine(e.Message); }

Errors

Errors and exceptions are being handled in the code. You can use the e.getMessage method for the respective programing language to get the Exception Message.