forked from ecoscope-platform-workflows-releases/events
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathspec.yaml
More file actions
351 lines (351 loc) · 10.5 KB
/
spec.yaml
File metadata and controls
351 lines (351 loc) · 10.5 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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
id: events
requirements:
- name: ecoscope-workflows-core
version: 0.1.5
channel: https://repo.prefix.dev/ecoscope-workflows/
- name: ecoscope-workflows-ext-ecoscope
version: 0.1.5
channel: https://repo.prefix.dev/ecoscope-workflows/
rjsf-overrides:
properties:
get_events_data.properties.event_types.ecoscope:event_type: properties.er_client_name.properties.data_source.properties.name
$defs:
ValueGrouper.oneOf:
- const: event_category
title: Event Category
- const: event_type
title: Event Type
- const: reported_by_name
title: Reported By Name
workflow:
- name: Workflow Details
id: workflow_details
task: set_workflow_details
- name: Data Source
id: er_client_name
task: set_er_connection
- name: Time Range
id: time_range
task: set_time_range
partial:
time_format: '%d %b %Y %H:%M:%S %Z'
- name: Get Events from EarthRanger
id: get_events_data
task: get_events
partial:
client: ${{ workflow.er_client_name.return }}
time_range: ${{ workflow.time_range.return }}
event_columns:
- id
- time
- event_type
- event_category
- reported_by
- serial_number
- geometry
raise_on_empty: true
- name: Extract reported_by_name from Events
id: extract_reported_by
task: extract_value_from_json_column
partial:
df: ${{ workflow.get_events_data.return }}
column_name: reported_by
field_name_options:
- name
output_type: str
output_column_name: reported_by_name
- name: Group Data
id: groupers
task: set_groupers
- name: Apply Relocation Coordinate Filter
id: filter_events
task: apply_reloc_coord_filter
partial:
df: ${{ workflow.extract_reported_by.return }}
roi_gdf: null
roi_name: null
- name: Add temporal index to Events
id: events_add_temporal_index
task: add_temporal_index
partial:
df: ${{ workflow.filter_events.return }}
time_col: time
groupers: ${{ workflow.groupers.return }}
cast_to_datetime: true
format: mixed
- name: Events Colormap
id: events_colormap
task: apply_color_map
partial:
df: ${{ workflow.events_add_temporal_index.return }}
input_column_name: event_type
colormap: tab20b
output_column_name: event_type_colormap
- name: Split Events by Group
id: split_event_groups
task: split_groups
partial:
df: ${{ workflow.events_colormap.return }}
groupers: ${{ workflow.groupers.return }}
- name: Draw Time Series Bar Chart for Events
id: events_bar_chart
task: draw_time_series_bar_chart
partial:
x_axis: time
y_axis: event_type
category: event_type
agg_function: count
color_column: event_type_colormap
plot_style:
xperiodalignment: middle
grouped_styles: null
layout_style: null
mapvalues:
argnames: dataframe
argvalues: ${{ workflow.split_event_groups.return }}
- name: Persist Bar Chart as Text
id: events_bar_chart_html_url
task: persist_text
partial:
root_path: ${{ env.ECOSCOPE_WORKFLOWS_RESULTS }}
mapvalues:
argnames: text
argvalues: ${{ workflow.events_bar_chart.return }}
- name: Create Bar Plot Widget for Events
id: events_bar_chart_widget
task: create_plot_widget_single_view
partial:
title: Events Bar Chart
map:
argnames:
- view
- data
argvalues: ${{ workflow.events_bar_chart_html_url.return }}
- name: Merge Bar Plot Widget Views
id: grouped_bar_plot_widget_merge
task: merge_widget_views
partial:
widgets: ${{ workflow.events_bar_chart_widget.return }}
- name: Rename columns for map tooltip display
id: rename_display_columns
task: map_columns
partial:
drop_columns: []
retain_columns: []
rename_columns:
serial_number: Event Serial
time: Event Time
event_type: Event Type
reported_by_name: Reported By
mapvalues:
argnames: df
argvalues: ${{ workflow.split_event_groups.return }}
- name: Base Maps
id: base_map_defs
task: set_base_maps
- name: Create map layer from grouped Events
id: grouped_events_map_layer
task: create_point_layer
partial:
layer_style:
fill_color_column: event_type_colormap
get_radius: 5
legend:
label_column: Event Type
color_column: event_type_colormap
tooltip_columns:
- Event Serial
- Event Time
- Event Type
- Reported By
mapvalues:
argnames: geodataframe
argvalues: ${{ workflow.rename_display_columns.return }}
- name: Draw Ecomap from grouped Events
id: grouped_events_ecomap
task: draw_ecomap
partial:
title: null
tile_layers: ${{ workflow.base_map_defs.return }}
north_arrow_style:
placement: top-left
legend_style:
placement: bottom-right
static: false
max_zoom: 20
mapvalues:
argnames: geo_layers
argvalues: ${{ workflow.grouped_events_map_layer.return }}
- name: Persist grouped Events Ecomap as Text
id: grouped_events_ecomap_html_url
task: persist_text
partial:
root_path: ${{ env.ECOSCOPE_WORKFLOWS_RESULTS }}
mapvalues:
argnames: text
argvalues: ${{ workflow.grouped_events_ecomap.return }}
- name: Create grouped Events Map Widget
id: grouped_events_map_widget
task: create_map_widget_single_view
partial:
title: Events Map
map:
argnames:
- view
- data
argvalues: ${{ workflow.grouped_events_ecomap_html_url.return }}
- name: Merge Events Map Widget Views
id: grouped_events_map_widget_merge
task: merge_widget_views
partial:
widgets: ${{ workflow.grouped_events_map_widget.return }}
- name: Draw Pie Chart for Events
id: grouped_events_pie_chart
task: draw_pie_chart
partial:
value_column: event_type
color_column: event_type_colormap
plot_style:
textinfo: value
label_column: null
layout_style: null
mapvalues:
argnames: dataframe
argvalues: ${{ workflow.split_event_groups.return }}
- name: Persist Pie Chart as Text
id: grouped_pie_chart_html_urls
task: persist_text
partial:
root_path: ${{ env.ECOSCOPE_WORKFLOWS_RESULTS }}
mapvalues:
argnames: text
argvalues: ${{ workflow.grouped_events_pie_chart.return }}
- name: Create Plot Widget for Events
id: grouped_events_pie_chart_widgets
task: create_plot_widget_single_view
partial:
title: Events Pie Chart
map:
argnames:
- view
- data
argvalues: ${{ workflow.grouped_pie_chart_html_urls.return }}
- name: Merge Pie Chart Widget Views
id: grouped_events_pie_widget_merge
task: merge_widget_views
partial:
widgets: ${{ workflow.grouped_events_pie_chart_widgets.return }}
- name: Create Events Meshgrid
id: events_meshgrid
task: create_meshgrid
partial:
aoi: ${{ workflow.events_add_temporal_index.return }}
intersecting_only: false
- name: Grouped Events Feature Density
id: grouped_events_feature_density
task: calculate_feature_density
partial:
meshgrid: ${{ workflow.events_meshgrid.return }}
geometry_type: point
mapvalues:
argnames: geodataframe
argvalues: ${{ workflow.split_event_groups.return }}
- name: Grouped Feature Density Colormap
id: grouped_fd_colormap
task: apply_color_map
partial:
input_column_name: density
colormap: RdYlGn_r
output_column_name: density_colormap
mapvalues:
argnames: df
argvalues: ${{ workflow.grouped_events_feature_density.return }}
- name: Sort Density By Classification
id: sort_grouped_density_values
task: sort_values
partial:
column_name: density
ascending: true
na_position: last
mapvalues:
argnames: df
argvalues: ${{ workflow.grouped_fd_colormap.return }}
- name: Format Grouped Feature Density Labels
id: grouped_feature_density_format
task: map_values_with_unit
partial:
original_unit: null
new_unit: null
input_column_name: density
output_column_name: density
decimal_places: 0
mapvalues:
argnames: df
argvalues: ${{ workflow.sort_grouped_density_values.return }}
- name: Create map layer from Feature Density
id: grouped_fd_map_layer
task: create_polygon_layer
partial:
layer_style:
fill_color_column: density_colormap
get_line_width: 0
opacity: 0.400000
legend:
label_column: density
color_column: density_colormap
tooltip_columns:
- density
mapvalues:
argnames: geodataframe
argvalues: ${{ workflow.grouped_feature_density_format.return}}
- name: Draw Ecomap from Feature Density
id: grouped_fd_ecomap
task: draw_ecomap
partial:
title: null
tile_layers: ${{ workflow.base_map_defs.return }}
north_arrow_style:
placement: top-left
legend_style:
title: Number of events
placement: bottom-right
static: false
max_zoom: 20
mapvalues:
argnames: geo_layers
argvalues: ${{ workflow.grouped_fd_map_layer.return }}
- name: Persist Feature Density Ecomap as Text
id: grouped_fd_ecomap_html_url
task: persist_text
partial:
root_path: ${{ env.ECOSCOPE_WORKFLOWS_RESULTS }}
mapvalues:
argnames: text
argvalues: ${{ workflow.grouped_fd_ecomap.return }}
- name: Create Feature Density Map Widget
id: grouped_fd_map_widget
task: create_map_widget_single_view
partial:
title: Density Map
map:
argnames:
- view
- data
argvalues: ${{ workflow.grouped_fd_ecomap_html_url.return }}
- name: Merge Feature Density Widget Views
id: grouped_fd_map_widget_merge
task: merge_widget_views
partial:
widgets: ${{ workflow.grouped_fd_map_widget.return }}
- name: Create Dashboard with Map Widgets
id: events_dashboard
task: gather_dashboard
partial:
details: ${{ workflow.workflow_details.return}}
widgets:
- ${{ workflow.grouped_bar_plot_widget_merge.return }}
- ${{ workflow.grouped_events_map_widget_merge.return }}
- ${{ workflow.grouped_events_pie_widget_merge.return }}
- ${{ workflow.grouped_fd_map_widget_merge.return }}
groupers: ${{ workflow.groupers.return }}
time_range: ${{ workflow.time_range.return}}