DAHITI-API

Download

Download of hypsometry model

DAHITI-API arguments

Argument Value Description
username e.g. 'username' Username to login on the DAHITI website
password e.g. 'password' Password to login on the DAHITI website
action 'download-hypsometry' Action of the request
dahiti_id e.g. '85' DAHITI ID

JSON response from DAHITI server

{
    'message': [],
    'status': 'OK',
    'target': {
        'id': '233',
        'target_name': 'Siling Co, Lake',
        'location': None,
        'country': 'China',
        'continent': 'Asia',
        'latitude': 31.7842,
        'longitude': 88.9357,
        'points': 208,
        'software': 1.0,
        'download': '2023-07-06 11:34:27'
    },
    'hypsometry': {
	'x_max': 2761.1202408,
        'x_min': 0.0083808225808,
        'x_wp': 2729.73547713,
        'y_min': 4515.51461229,
        'y_scale': 59.8642535015,
        'z': 0.297073758752
    }
}

Python-Example:

import requests
import json
import pprint

url = 'https://dahiti.dgfi.tum.de/api/v1/'

args = {}
""" required options """
args['username'] = 'username'
args['password'] = 'password'
args['action'] = 'download-hypsometry'
args['dahiti_id'] = '233'

""" send request as method POST """
response = requests.post(url, data=args)

if response.status_code == 200:
	""" convert json string in python list """
	data = json.loads(response.text)
	pprint.pprint(data)
else:
	print response.status_code


Curl-Example:

curl --data "username=username&password=password&action=download-hypsometry&dahiti_id=233" -X POST https://dahiti.dgfi.tum.de/api/v1/

Find more topics on the central web site of the Technical University of Munich: www.tum.de