-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy patharray_apply.json
102 lines (102 loc) · 3.69 KB
/
array_apply.json
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
{
"id": "array_apply",
"summary": "Applies a unary process to each array element",
"description": "Applies a **unary** process which takes a single value such as `abs` or `sqrt` to each value in the array. This is basically what other languages call either a `for each` loop or a `map` function.",
"categories": [
"arrays"
],
"parameters": [
{
"name": "data",
"description": "An array.",
"schema": {
"type": "array",
"items": {
"description": "Any data type is allowed."
}
}
},
{
"name": "process",
"description": "A process to be applied on each value, may consist of multiple sub-processes. The specified process must be unary meaning that it must work on a single value.",
"schema": {
"type": "object",
"subtype": "process-graph",
"parameters": [
{
"name": "x",
"description": "The value of the current element being processed.",
"schema": {
"description": "Any data type."
}
},
{
"name": "index",
"description": "The zero-based index of the current element being processed.",
"schema": {
"type": "integer"
}
},
{
"name": "label",
"description": "The label of the current element being processed. Only populated for labeled arrays.",
"schema": [
{
"type": "number"
},
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"optional": true
},
{
"name": "context",
"description": "Additional data passed by the user.",
"schema": {
"description": "Any data type."
},
"optional": true,
"default": null
}
]
}
},
{
"name": "context",
"description": "Additional data to be passed to the process.",
"schema": {
"description": "Any data type."
},
"optional": true,
"default": null
}
],
"returns": {
"description": "An array with the newly computed values. The number of elements are the same as for the original array.",
"schema": {
"type": "array",
"items": {
"description": "Any data type is allowed."
}
}
},
"links": [
{
"rel": "example",
"type": "application/json",
"href": "https://processes.openeo.org/draft/examples/array_find_nodata.json",
"title": "Find no-data values in arrays"
},
{
"rel": "example",
"type": "application/json",
"href": "https://processes.openeo.org/draft/examples/array_contains_nodata.json",
"title": "Check for no-data values in arrays"
}
]
}