Skip to content

Commit cee65f7

Browse files
committed
Merge remote-tracking branch 'origin/examples'
2 parents 154cb5b + deac62f commit cee65f7

6 files changed

Lines changed: 423 additions & 0 deletions

File tree

examples/README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Examples
2+
3+
This folder contains process graphs that show how the openEO processes work in practice.
4+
5+
* [NDVI-UC1: Deriving maximum NDVI measurements over pixel time series](ndvi-uc1/README.md)
6+
* [ZONAL-UC3: Compute time series of zonal (regional) statistics over user-specified polygons](zonal-uc3/README.md)
7+
* [EVI: Deriving minimum EVI measurements over pixel time series](evi/README.md)
8+
9+
Please feel encouraged to add your owns via Pull Requests!
10+

examples/evi/README.md

Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
# EVI (Enhanced Vegetation Index)
2+
3+
This example derives minimum EVI measurements over pixel time series of Sentinel 2 imagery. The EVI is defined as follows: `(2.5 * (nir - red)) / ((nir + 6.0 * red - 7.5 * blue) + 1.0)`
4+
5+
The process graph could be visualized as follows:
6+
7+
![Graph visualization](visual.png)
8+
9+
This process graph is meant to be used as batch job or can be lazy evaluated. It returns a GeoTiff file with the computed results.
10+
11+
This process graph assumes the dataset is called `Sentinel-2`. The temporal extent covered is January 2018 and bands `B02` (blue), `B04` (red) and `B08` (nir) are used for the computation. Please note that the order of the bands in `get_collection` is important as they are requested by their order (index) in the callback.
12+
13+
## Process Graph
14+
15+
```json
16+
{
17+
"dc": {
18+
"process_id": "load_collection",
19+
"process_description": "Loading the data; The order of the specified bands is important for the following reduce operation.",
20+
"arguments": {
21+
"id": "Sentinel-2",
22+
"spatial_extent": {
23+
"west": 16.1,
24+
"east": 16.6,
25+
"north": 48.6,
26+
"south": 47.2
27+
},
28+
"temporal_extent": ["2018-01-01", "2018-02-01"],
29+
"bands": ["B08", "B04", "B02"]
30+
}
31+
},
32+
"evi": {
33+
"process_id": "reduce",
34+
"process_description": "Compute the EVI. Formula: 2.5 * (NIR - RED) / (1 + NIR + 6*RED + -7.5*BLUE)",
35+
"arguments": {
36+
"data": {"from_node": "dc"},
37+
"dimension": "spectral",
38+
"reducer": {
39+
"callback": {
40+
"nir": {
41+
"process_id": "array_element",
42+
"arguments": {
43+
"data": {"from_argument": "data"},
44+
"index": 0
45+
}
46+
},
47+
"red": {
48+
"process_id": "array_element",
49+
"arguments": {
50+
"data": {"from_argument": "data"},
51+
"index": 1
52+
}
53+
},
54+
"blue": {
55+
"process_id": "array_element",
56+
"arguments": {
57+
"data": {"from_argument": "data"},
58+
"index": 2
59+
}
60+
},
61+
"sub": {
62+
"process_id": "subtract",
63+
"arguments": {
64+
"data": [{"from_node": "nir"}, {"from_node": "red"}]
65+
}
66+
},
67+
"p1": {
68+
"process_id": "product",
69+
"arguments": {
70+
"data": [6, {"from_node": "red"}]
71+
}
72+
},
73+
"p2": {
74+
"process_id": "product",
75+
"arguments": {
76+
"data": [-7.5, {"from_node": "blue"}]
77+
}
78+
},
79+
"sum": {
80+
"process_id": "sum",
81+
"arguments": {
82+
"data": [1, {"from_node": "nir"}, {"from_node": "p1"}, {"from_node": "p2"}]
83+
}
84+
},
85+
"div": {
86+
"process_id": "divide",
87+
"arguments": {
88+
"data": [{"from_node": "sub"}, {"from_node": "sum"}]
89+
}
90+
},
91+
"p3": {
92+
"process_id": "product",
93+
"arguments": {
94+
"data": [2.5, {"from_node": "div"}]
95+
},
96+
"result": true
97+
}
98+
}
99+
}
100+
}
101+
},
102+
"mintime": {
103+
"process_id": "reduce",
104+
"process_description": "Compute a minimum time composite by reducing the temporal dimension",
105+
"arguments": {
106+
"data": {"from_node": "evi"},
107+
"dimension": "temporal",
108+
"reducer": {
109+
"callback": {
110+
"min": {
111+
"process_id": "min",
112+
"arguments": {
113+
"data": {"from_argument": "data"}
114+
},
115+
"result": true
116+
}
117+
}
118+
}
119+
}
120+
},
121+
"save": {
122+
"process_id": "save_result",
123+
"arguments": {
124+
"data": {"from_node": "mintime"},
125+
"format": "GTiff"
126+
},
127+
"result": true
128+
}
129+
}
130+
```
131+
132+
## Result
133+
134+
TBD

examples/evi/visual.png

79.2 KB
Loading

examples/ndvi-uc1/README.md

Lines changed: 165 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,165 @@
1+
# NDVI (POC Use Case 1)
2+
3+
This example derives maximum NDVI measurements over pixel time series of Sentinel 2 imagery.
4+
5+
This process graph is meant to be used as secondary web service. If you want to run it as a batch job, you'd need to store the results to a file with the `save_result` process.
6+
7+
This process graph assumes the dataset is called `Sentinel-2`. It receives the spatial extent for the data to compute from the secondary web service as variables in `spatial_extent_west`, `spatial_extent_east` etc. The temporal extent covered is January 2018.
8+
9+
Process Graph #1 computes the NDVI based on the common band names in the metadata. If these entries are not available, you'd need to switch the process to `normalized_difference` in combination with `filter_bands` to manually specify the red and nir bands. This is shown in Process Graph #2.
10+
11+
## Process Graphs
12+
13+
### #1
14+
15+
```json
16+
{
17+
"loadco1": {
18+
"process_id": "load_collection",
19+
"arguments": {
20+
"id": "Sentinel-2",
21+
"spatial_extent": {
22+
"west": {
23+
"variable_id": "spatial_extent_west"
24+
},
25+
"east": {
26+
"variable_id": "spatial_extent_east"
27+
},
28+
"north": {
29+
"variable_id": "spatial_extent_north"
30+
},
31+
"south": {
32+
"variable_id": "spatial_extent_south"
33+
}
34+
},
35+
"temporal_extent": [
36+
"2018-01-01",
37+
"2018-02-01"
38+
]
39+
}
40+
},
41+
"ndvi1": {
42+
"process_id": "ndvi",
43+
"arguments": {
44+
"data": {
45+
"from_node": "loadco1"
46+
}
47+
}
48+
},
49+
"reduce1": {
50+
"process_id": "reduce",
51+
"arguments": {
52+
"data": {
53+
"from_node": "ndvi1"
54+
},
55+
"dimension": "temporal",
56+
"reducer": {
57+
"callback": {
58+
"max1": {
59+
"process_id": "max",
60+
"arguments": {
61+
"data": {
62+
"from_argument": "data"
63+
}
64+
},
65+
"result": true
66+
}
67+
}
68+
}
69+
},
70+
"result": true
71+
}
72+
}
73+
```
74+
75+
### #2
76+
77+
```json
78+
{
79+
"load_collection": {
80+
"arguments": {
81+
"id": "Sentinel-2",
82+
"spatial_extent": {
83+
"west": {
84+
"variable_id": "spatial_extent_west"
85+
},
86+
"east": {
87+
"variable_id": "spatial_extent_east"
88+
},
89+
"north": {
90+
"variable_id": "spatial_extent_north"
91+
},
92+
"south": {
93+
"variable_id": "spatial_extent_south"
94+
}
95+
},
96+
"temporal_extent": [
97+
"2018-01-01",
98+
"2018-02-01"
99+
]
100+
},
101+
"process_id": "load_collection"
102+
},
103+
"b1": {
104+
"arguments": {
105+
"data": {
106+
"from_node": "load_collection"
107+
},
108+
"bands": [
109+
"B4"
110+
]
111+
},
112+
"process_id": "filter_bands"
113+
},
114+
"b2": {
115+
"arguments": {
116+
"data": {
117+
"from_node": "load_collection"
118+
},
119+
"bands": [
120+
"B8"
121+
]
122+
},
123+
"process_id": "filter_bands"
124+
},
125+
"normalized_difference": {
126+
"arguments": {
127+
"band1": {
128+
"from_node": "b1"
129+
},
130+
"band2": {
131+
"from_node": "b2"
132+
}
133+
},
134+
"process_id": "normalized_difference"
135+
},
136+
"reduce": {
137+
"arguments": {
138+
"data": {
139+
"from_node": "normalized_difference"
140+
},
141+
"dimension": "temporal",
142+
"reducer": {
143+
"callback": {
144+
"max": {
145+
"arguments": {
146+
"data": {
147+
"from_argument": "data"
148+
}
149+
},
150+
"process_id": "max",
151+
"result": true
152+
}
153+
}
154+
}
155+
},
156+
"process_id": "reduce"
157+
}
158+
}
159+
```
160+
161+
## Result
162+
163+
Executing this process graph on Google Earth Engine gives the following exemplary results for a user-defined area:
164+
165+
![Resulting Image](gee-result.png)

examples/ndvi-uc1/gee-result.png

531 KB
Loading

0 commit comments

Comments
 (0)