Skip to content

Commit 5110101

Browse files
committed
initial setup
1 parent 30f922e commit 5110101

File tree

4 files changed

+201
-0
lines changed

4 files changed

+201
-0
lines changed

algorithm_catalog/vito/random_forest_firemapping/benchmark_scenarios/random_forest_firemapping.json

Whitespace-only changes.
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
import json
2+
from pathlib import Path
3+
import openeo
4+
from openeo.api.process import Parameter
5+
from openeo.rest.udp import build_process_dict
6+
7+
8+
def generate() -> dict:
9+
10+
conn = openeo.connect("openeo.vito.be").authenticate_oidc()
11+
12+
# define input parameter
13+
spatial_extent = Parameter.spatial_extent(
14+
name = "spatial_extent",
15+
description = "Limits the data to process to the specified bounding box or polygons."
16+
)
17+
18+
temporal_extent = Parameter.temporal_interval(
19+
name = "temporal_extent",
20+
description = "Temporal extent specified as two-element array with start and end date/date-time."
21+
)
22+
# Load s2 bands and set max cloud cover to be less than 10%
23+
s2_bands = conn.load_collection(
24+
collection_id="SENTINEL2_L2A",
25+
spatial_extent=spatial_extent,
26+
temporal_extent=temporal_extent,
27+
bands=["B04", "B08"],
28+
max_cloud_cover=10,
29+
)
30+
31+
# Build the process dictionary
32+
return build_process_dict(
33+
process_graph=s2_bands,
34+
process_id="s2_bands",
35+
summary="s2_bands",
36+
description="s2_bands",
37+
parameters=[spatial_extent, temporal_extent]
38+
)
39+
40+
41+
if __name__ == "__main__":
42+
# save the generated process to a file
43+
with open(Path(__file__).parent / "random_forest_firemapping.json", "w") as f:
44+
json.dump(generate(), f, indent=2)
Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
1+
{
2+
"process_graph": {
3+
"loadcollection1": {
4+
"process_id": "load_collection",
5+
"arguments": {
6+
"bands": [
7+
"B04",
8+
"B08"
9+
],
10+
"id": "SENTINEL2_L2A",
11+
"properties": {
12+
"eo:cloud_cover": {
13+
"process_graph": {
14+
"lte1": {
15+
"process_id": "lte",
16+
"arguments": {
17+
"x": {
18+
"from_parameter": "value"
19+
},
20+
"y": 10
21+
},
22+
"result": true
23+
}
24+
}
25+
}
26+
},
27+
"spatial_extent": {
28+
"from_parameter": "spatial_extent"
29+
},
30+
"temporal_extent": {
31+
"from_parameter": "temporal_extent"
32+
}
33+
},
34+
"result": true
35+
}
36+
},
37+
"id": "s2_bands",
38+
"summary": "s2_bands",
39+
"description": "s2_bands",
40+
"parameters": [
41+
{
42+
"name": "spatial_extent",
43+
"description": "Limits the data to process to the specified bounding box or polygons.",
44+
"schema": [
45+
{
46+
"title": "Bounding Box",
47+
"type": "object",
48+
"subtype": "bounding-box",
49+
"required": [
50+
"west",
51+
"south",
52+
"east",
53+
"north"
54+
],
55+
"properties": {
56+
"west": {
57+
"description": "West (lower left corner, coordinate axis 1).",
58+
"type": "number"
59+
},
60+
"south": {
61+
"description": "South (lower left corner, coordinate axis 2).",
62+
"type": "number"
63+
},
64+
"east": {
65+
"description": "East (upper right corner, coordinate axis 1).",
66+
"type": "number"
67+
},
68+
"north": {
69+
"description": "North (upper right corner, coordinate axis 2).",
70+
"type": "number"
71+
},
72+
"base": {
73+
"description": "Base (optional, lower left corner, coordinate axis 3).",
74+
"type": [
75+
"number",
76+
"null"
77+
],
78+
"default": null
79+
},
80+
"height": {
81+
"description": "Height (optional, upper right corner, coordinate axis 3).",
82+
"type": [
83+
"number",
84+
"null"
85+
],
86+
"default": null
87+
},
88+
"crs": {
89+
"description": "Coordinate reference system of the extent, specified as as [EPSG code](http://www.epsg-registry.org/) or [WKT2 CRS string](http://docs.opengeospatial.org/is/18-010r7/18-010r7.html). Defaults to `4326` (EPSG code 4326) unless the client explicitly requests a different coordinate reference system.",
90+
"anyOf": [
91+
{
92+
"title": "EPSG Code",
93+
"type": "integer",
94+
"subtype": "epsg-code",
95+
"minimum": 1000,
96+
"examples": [
97+
3857
98+
]
99+
},
100+
{
101+
"title": "WKT2",
102+
"type": "string",
103+
"subtype": "wkt2-definition"
104+
}
105+
],
106+
"default": 4326
107+
}
108+
}
109+
},
110+
{
111+
"title": "Vector data cube",
112+
"description": "Limits the data cube to the bounding box of the given geometries in the vector data cube. For raster data, all pixels inside the bounding box that do not intersect with any of the polygons will be set to no data (`null`). Empty geometries are ignored.",
113+
"type": "object",
114+
"subtype": "datacube",
115+
"dimensions": [
116+
{
117+
"type": "geometry"
118+
}
119+
]
120+
},
121+
{
122+
"title": "No filter",
123+
"description": "Don't filter spatially. All data is included in the data cube.",
124+
"type": "null"
125+
}
126+
]
127+
},
128+
{
129+
"name": "temporal_extent",
130+
"description": "Temporal extent specified as two-element array with start and end date/date-time.",
131+
"schema": {
132+
"type": "array",
133+
"subtype": "temporal-interval",
134+
"uniqueItems": true,
135+
"minItems": 2,
136+
"maxItems": 2,
137+
"items": {
138+
"anyOf": [
139+
{
140+
"type": "string",
141+
"subtype": "date-time",
142+
"format": "date-time"
143+
},
144+
{
145+
"type": "string",
146+
"subtype": "date",
147+
"format": "date"
148+
},
149+
{
150+
"type": "null"
151+
}
152+
]
153+
}
154+
}
155+
}
156+
]
157+
}

algorithm_catalog/vito/random_forest_firemapping/records/random_forest_firemapping.json

Whitespace-only changes.

0 commit comments

Comments
 (0)