-
Notifications
You must be signed in to change notification settings - Fork 42
/
Copy pathvito_example.py
47 lines (31 loc) · 1 KB
/
vito_example.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import json
import logging
import openeo
logging.basicConfig(level=logging.INFO)
VITO_DRIVER_URL = "openeo.vito.be"
OUTPUT_FILE = "/tmp/openeo_vito_output.png"
con = openeo.connect(VITO_DRIVER_URL).authenticate_oidc()
#Test Connection
print(con.list_processes())
print(con.list_collections())
print(con.describe_collection("CGLS_LAI300_V1_GLOBAL"))
# Test Capabilities
cap = con.capabilities()
print(cap.version())
print(cap.list_features())
print(cap.currency())
print(cap.list_plans())
# Test Processes
datacube = con.load_collection("CGLS_LAI300_V1_GLOBAL")
datacube = datacube.filter_bbox(west=16.138916, south=48.138600, east=16.524124, north=48.320647, crs=4326)
datacube = datacube.filter_daterange(extent=["2016-01-01T00:00:00Z", "2016-03-10T23:59:59Z"])
datacube = datacube.max_time()
print(datacube.to_json())
# Test Job
datacube.download("/tmp/testfile.tiff")
job = datacube.create_job()
if job:
print(job.job_id)
print(job.run_synchronous("/tmp/testfile"))
else:
print("Job ID is None")