Documentation of DAHITI-API (Version 2) - "download-bathymetry"
DAHITI-API arguments
Argument Value Description
api_key ---' DAHITI API-Key
(Where can I get the API key?)
dahiti_id e.g. '8813' DAHITI ID
API-Request URL
https://dahiti.dgfi.tum.de/api/v2/download-bathymetry/
Response from DAHITI server
 Returns GeoTiff or JSON Error
API-Request Examples:

Python request using POST method:

import requests
import json
import pprint

url = "https://dahiti.dgfi.tum.de/api/v2/download-bathymetry/"

args = {}
args['api_key'] = '### ADD HERE API_KEY ###'
args['dahiti_id'] = 8813

response = requests.post(url, json=args)

if response.status_code == 200:
	local_filename = args['dahiti_id']+'_bathymetry.tif'
	print ('writing ... '+local_filename)
	with open(local_filename, 'wb') as f:
		for chunk in response.iter_content(chunk_size=1024): 
			if chunk:
				f.write(chunk)
	print ('done!')
else:	
	data = json.loads(response.text)
	pprint.pprint(data)
	

Python request using GET method:

import requests
import json
import pprint

url = "https://dahiti.dgfi.tum.de/api/v2/download-bathymetry/"

args = {}
args['api_key'] = '### ADD HERE API_KEY ###'
args['dahiti_id'] = 8813


response = requests.get(url,params=args)

if response.status_code == 200:
	local_filename = args['dahiti_id']+'_bathymetry.tif'
	print ('writing ... '+local_filename)
	with open(local_filename, 'wb') as f:
		for chunk in response.iter_content(chunk_size=1024): 
			if chunk:
				f.write(chunk)
	print ('done!')	
else:
	data = json.loads(response.text)
	pprint.pprint(data)
				

CURL request using POST method:

curl --data "api_key=### ADD HERE API_KEY ###&dahiti_id=8813" -X POST https://dahiti.dgfi.tum.de/api/v2/download-bathymetry/ --output 8813_bathymetry.tif
			

CURL request using GET method:

curl -X GET "https://dahiti.dgfi.tum.de/api/v2/download-bathymetry/?api_key=### ADD HERE API_KEY ###&dahiti_id=8813" --output 8813_bathymetry.tif