-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathactinia_stac.sh
More file actions
153 lines (126 loc) · 5.15 KB
/
Copy pathactinia_stac.sh
File metadata and controls
153 lines (126 loc) · 5.15 KB
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
#!/bin/bash
# Example on STAC support in actinia for import and export
# See: https://mundialis.github.io/fossgis2022/stac-openeo-actinia/index.html for more details
# Please note that the following requests will fail if run again, as objects have already been created
# Set up connection
export ACTINIA_URL=http://nve-actinia.westeurope.cloudapp.azure.com:5000/api/v3
export AUTH='-u username:password'
# Create DLR STAC instance
STAC_JSON='{
"stac_instance_id": "dlr"
}'
curl ${AUTH} -X POST -i "${ACTINIA_URL}/stac/instances" -H "accept: application/json" -H "content-type: application/json" -d "$STAC_JSON"
# Register Sentinel-5P cloud data from DLR STAC instance
STAC_JSON='{
"stac_instance_id": "dlr",
"stac_url": "https://geoserver.dlr.loose.eox.at/ogc/stac/collections/S5P_TROPOMI_L2_OFFL_CLOUD"
}'
curl ${AUTH} -X POST -i "${ACTINIA_URL}/stac/collections" -H "accept: application/json" -H "content-type: application/json" -d "$STAC_JSON"
# Register Sentinel-1 L1 GRD from DLR STAC instance
STAC_JSON='{
"stac_instance_id": "dlr",
"stac_url": "https://geoserver.dlr.loose.eox.at/ogc/stac/collections/S1_L1_GRD"
}'
curl ${AUTH} -X POST -i "${ACTINIA_URL}/stac/collections" -H "accept: application/json" -H "content-type: application/json" -d "$STAC_JSON"
# Create AWS STAC instance
STAC_JSON='{
"stac_instance_id": "aws"
}'
curl ${AUTH} -X POST -i "${ACTINIA_URL}/stac/instances" -H "accept: application/json" -H "content-type: application/json" -d "$STAC_JSON"
# Register Sentinel-2 L2A data from AWS STAC instance
STAC_JSON='{
"stac_instance_id": "aws",
"stac_url": "https://earth-search.aws.element84.com/v0/collections/sentinel-s2-l2a"
}'
curl ${AUTH} -X POST -i "${ACTINIA_URL}/stac/collections" -H "accept: application/json" -H "content-type: application/json" -d "$STAC_JSON"
# Now data from those STAC collections can be imported and used for processing
# Need to add an example
# Get some more information about the registered STACs
curl ${AUTH} "${ACTINIA_URL}/stac/collections/stac.aws.rastercube.sentinel-s2-l2a"
# Unfortunately it is in a "requester pays bucket"
# This is how import from STAC would work
STAC_IMPORT_JSON='{"list":[{
"module": "importer",
"id": "importer_DLR_S1_L1_GRD",
"inputs":[
{"import_descr": {
"source": "stac.dlr.rastercube.S1_L1_GRD",
"type": "stac",
"semantic_label": "VH",
"extent": {
"spatial": {
"bbox": [[10.08057,59.61553,10.93976,60.17929]]},
"temporal": {
"interval": [["2020-06-25", "2020-07-10"]]
}
},
"filter": {}
},
"param": "map",
"value": "S1_L1_GRD_VH"
}]
}],
"version": "3"
}'
curl ${AUTH} -X POST -i "${ACTINIA_URL}/locations/ETRS_33N/mapsets/S1_L1_GRD_STAC_test/processing_async" -H "accept: application/json" -H "content-type: application/json" -d "$STAC_IMPORT_JSON"
# This is how import from STAC would work
STAC_IMPORT_JSON='{"list":[{
"module": "importer",
"id": "importer_S2_AWS_1",
"inputs":[
{"import_descr": {
"source": "stac.aws.rastercube.sentinel-s2-l2a",
"type": "stac",
"semantic_label": "B01",
"extent": {
"spatial": {
"bbox": [[10.08057,59.61553,10.93976,60.17929]]},
"temporal": {
"interval": [["2022-07-05", "2022-07-10"]]
}
},
"filter": {}
},
"param": "map",
"value": "S2_B01"
}]
}],
"version": "3"
}'
curl ${AUTH} -X POST -i "${ACTINIA_URL}/locations/ETRS_33N/mapsets/S2_AWS_STAC_test/processing_async" -H "accept: application/json" -H "content-type: application/json" -d "$STAC_IMPORT_JSON"
# Register Sentinel-2 L2A data from AWS STAC instance
STAC_JSON='{
"stac_instance_id": "tamn",
}'
curl ${AUTH} -X POST -i "${ACTINIA_URL}/stac/instances" -H "accept: application/json" -H "content-type: application/json" -d "$STAC_JSON"
# Register Sentinel-2 L2A data from AWS STAC instance
STAC_JSON='{
"stac_instance_id": "tamn",
"stac_url": "https://tamn.snapplanet.io/collections/S2"
}'
curl ${AUTH} -X POST -i "${ACTINIA_URL}/stac/collections" -H "accept: application/json" -H "content-type: application/json" -d "$STAC_JSON"
# This is how import from STAC would work
STAC_IMPORT_JSON='{"list":[{
"module": "importer",
"id": "importer_S2_TAMN_1",
"inputs":[
{"import_descr": {
"source": "stac.tamn.rastercube.S2",
"type": "stac",
"semantic_label": "B01",
"extent": {
"spatial": {
"bbox": [[10.08057,59.61553,10.93976,60.17929]]},
"temporal": {
"interval": [["2022-07-01", "2022-07-15"]]
}
},
"filter": {}
},
"param": "map",
"value": "S2_B01"
}]
}],
"version": "3"
}'
curl ${AUTH} -X POST -i "${ACTINIA_URL}/locations/ETRS_33N/mapsets/S2_TAMN_STAC_test/processing_async" -H "accept: application/json" -H "content-type: application/json" -d "$STAC_IMPORT_JSON"