diff --git a/proposals/aggregate_spatial_window.json b/proposals/aggregate_spatial_window.json new file mode 100644 index 00000000..df4bd4e6 --- /dev/null +++ b/proposals/aggregate_spatial_window.json @@ -0,0 +1,106 @@ +{ + "id": "aggregate_spatial_window", + "summary": "Zonal statistics for rectangular windows", + "description": "Aggregates statistics over the horizontal spatial dimensions (axes `x` and `y`) of the data cube.\n\nThe pixel grid for the axes `x` and `y` is divided into non-overlapping windows with the size specified in the parameter `size`. If the number of values for the axes `x` and `y` is not a multiple of the corresponding window size, the behaviour specified in the parameters `boundary` and `align` is applied.\nFor each of these windows, the reducer process computes the result.", + "categories": [ + "cubes", + "aggregate & resample" + ], + "experimental": true, + "parameters": [ + { + "name": "data", + "description": "A raster data cube with exactly two horizontal spatial dimensions and an arbitrary number of additional dimensions. The process is applied to all additional dimensions individually.", + "schema": { + "type": "object", + "subtype": "raster-cube" + } + }, + { + "name": "reducer", + "description": "A reducer to be applied on the list of values, which contain all pixels covered by the window. A reducer is a single process such as ``mean()`` or a set of processes, which computes a single value for a list of values, see the category 'reducer' for such processes.", + "schema": { + "type": "object", + "subtype": "process-graph", + "parameters": [ + { + "name": "data", + "description": "An array with elements of any type.", + "schema": { + "type": "array", + "items": { + "description": "Any data type." + } + } + }, + { + "name": "context", + "description": "Additional data passed by the user.", + "schema": { + "description": "Any data type." + }, + "optional": true, + "default": null + } + ] + } + }, + { + "name": "size", + "description": "Window sizes in pixels along the horizontal spatial dimensions.\n\nThe first value corresponds to the `x` axis, the second values corresponds to the `y` axis.", + "schema": { + "type": "array", + "minItems": 2, + "maxItems": 2, + "items": { + "type": "integer", + "minimum": 1 + } + } + }, + { + "name": "boundary", + "description": "Behaviour to apply if the number of values for the axes `x` and `y` is not a multiple of the corresponding value in the `size` parameter. Options are:\n\n- `pad` (default): pad the data cube with the no-data value `null` to fit the required window size.\n\n- `trim`: trim the data cube to fit the required window size.\n\nSet the parameter `align` to specifies to which corner the data is aligned to.", + "schema": { + "type": "string", + "enum": [ + "pad", + "trim" + ] + }, + "optional": true, + "default": "pad" + }, + { + "name": "align", + "description": "If the data requires padding or trimming (see parameter `boundary`), specifies to which corner of the spatial extent the data is aligned to. For example, if the data is aligned to the upper left, the process pads/trims at the lower-right.", + "schema": { + "type": "string", + "enum": [ + "lower-left", + "upper-left", + "lower-right", + "upper-right" + ] + }, + "default": "upper-left", + "optional": true + }, + { + "name": "context", + "description": "Additional data to be passed to the reducer.", + "schema": { + "description": "Any data type." + }, + "optional": true, + "default": null + } + ], + "returns": { + "description": "A data cube with the newly computed values and the same dimensions.\n\nThe resolution will change depending on the chosen values for the `size` and `boundary` parameter. It usually decreases for the dimensions which have the corresponding parameter `size` set to values greater than 1.\n\nThe dimension labels will be set to the coordinate at the center of the window. The other dimension properties (name, type and reference system) remain unchanged.", + "schema": { + "type": "object", + "subtype": "raster-cube" + } + } +} \ No newline at end of file