Argument | Value | Description |
api_key | ---' | DAHITI API-Key (Where can I get the API key?) |
dahiti_id | e.g. '8813' | DAHITI ID |
https://dahiti.dgfi.tum.de/api/v2/download-bathymetry/
Returns GeoTiff or JSON Error
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)
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 --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 -X GET "https://dahiti.dgfi.tum.de/api/v2/download-bathymetry/?api_key=### ADD HERE API_KEY ###&dahiti_id=8813" --output 8813_bathymetry.tif