From f5c18eb715c8446a5fe6d8db170e34e2ce459f48 Mon Sep 17 00:00:00 2001 From: Matthias Mohr Date: Wed, 7 Sep 2022 13:53:48 +0200 Subject: [PATCH] Started updating processes... --- CHANGELOG.md | 10 ++++ add_dimension.json | 9 ++-- aggregate_spatial.json | 36 +++++++++---- aggregate_temporal.json | 16 ++++-- aggregate_temporal_period.json | 16 ++++-- anomaly.json | 21 ++++++-- apply.json | 8 +-- apply_dimension.json | 14 ++--- apply_kernel.json | 26 ++++++++-- apply_neighborhood.json | 50 +++++++++++++++--- climatological_normal.json | 14 ++++- ..._raster_cube.json => create_data_cube.json | 12 ++--- dimension_labels.json | 4 +- drop_dimension.json | 6 +-- filter_bands.json | 16 ++++-- filter_bbox.json | 30 +++++++++-- filter_spatial.json | 30 +++++++++-- filter_temporal.json | 14 ++++- load_collection.json | 6 +-- mask_polygon.json | 24 +++++++-- meta/subtype-schemas.json | 12 ++++- ndvi.json | 25 ++++++++- proposals/aggregate_spatial_window.json | 26 ++++++++-- .../ard_normalized_radar_backscatter.json | 34 ++++++++++-- proposals/ard_surface_reflectance.json | 34 ++++++++++-- proposals/atmospheric_correction.json | 34 ++++++++++-- proposals/cloud_detection.json | 34 ++++++++++-- proposals/filter_labels.json | 6 +-- proposals/fit_class_random_forest.json | 14 ++++- proposals/fit_curve.json | 8 +-- proposals/fit_regr_random_forest.json | 14 ++++- proposals/flatten_dimensions.json | 4 +- proposals/load_result.json | 2 +- proposals/load_uploaded_files.json | 2 +- proposals/predict_curve.json | 10 ++-- proposals/reduce_spatial.json | 19 +++++-- proposals/resample_cube_temporal.json | 23 ++++++-- proposals/sar_backscatter.json | 32 ++++++++++-- proposals/unflatten_dimension.json | 4 +- proposals/vector_buffer.json | 14 ++++- proposals/vector_to_random_points.json | 14 ++++- proposals/vector_to_regular_points.json | 14 ++++- reduce_dimension.json | 6 +-- rename_dimension.json | 6 +-- rename_labels.json | 4 +- resample_cube_spatial.json | 39 +++++++++++--- resample_spatial.json | 24 +++++++-- save_result.json | 14 ++--- tests/package.json | 2 +- tests/testHelpers.js | 52 ++++++++++++++++++- trim_cube.json | 10 ++-- 51 files changed, 719 insertions(+), 179 deletions(-) rename create_raster_cube.json => create_data_cube.json (53%) diff --git a/CHANGELOG.md b/CHANGELOG.md index c11339c8..6cdb52fb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,16 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## Changes for vector cubes + +- Update the processes based on `raster-cubes` to work with `datacube` instead +- Renamed `create_raster_cube` to `create_data_cube` +- `add_dimension`: Added new dimension type `vector` +- New definition for `aggregate_spatial`: + - Allows more than 3 input dimensions + - Allow to not export statistics by changing the parameter `target_dimenaion` + - Clarified how the resulting vector cube looks like + ## Unreleased / Draft ### Added diff --git a/add_dimension.json b/add_dimension.json index a3b07075..a7c76d13 100644 --- a/add_dimension.json +++ b/add_dimension.json @@ -11,7 +11,7 @@ "description": "A data cube to add the dimension to.", "schema": { "type": "object", - "subtype": "raster-cube" + "subtype": "datacube" } }, { @@ -39,9 +39,10 @@ "schema": { "type": "string", "enum": [ + "bands", "spatial", "temporal", - "bands", + "vector", "other" ] }, @@ -53,7 +54,7 @@ "description": "The data cube with a newly added dimension. The new dimension has exactly one dimension label. All other dimensions remain unchanged.", "schema": { "type": "object", - "subtype": "raster-cube" + "subtype": "datacube" } }, "exceptions": { @@ -61,4 +62,4 @@ "message": "A dimension with the specified name already exists." } } -} \ No newline at end of file +} diff --git a/aggregate_spatial.json b/aggregate_spatial.json index 4020610c..81f8c1ca 100644 --- a/aggregate_spatial.json +++ b/aggregate_spatial.json @@ -1,7 +1,7 @@ { "id": "aggregate_spatial", "summary": "Zonal statistics for geometries", - "description": "Aggregates statistics for one or more geometries (e.g. zonal statistics for polygons) over the spatial dimensions. The number of total and valid pixels is returned together with the calculated values.\n\nAn 'unbounded' aggregation over the full extent of the horizontal spatial dimensions can be computed with the process ``reduce_spatial()``.\n\nThis process passes a list of values to the reducer. The list of values has an undefined order, therefore processes such as ``last()`` and ``first()`` that depend on the order of the values will lead to unpredictable results.", + "description": "Aggregates statistics for one or more geometries (e.g. zonal statistics for polygons) over the spatial dimensions. The given data cube can have multiple additional dimension and for all these dimensions results will be computed individually.\n\nAn 'unbounded' aggregation over the full extent of the horizontal spatial dimensions can be computed with the process ``reduce_spatial()``.\n\nThis process passes a list of values to the reducer. The list of values has an undefined order, therefore processes such as ``last()`` and ``first()`` that depend on the order of the values will lead to unpredictable results.", "categories": [ "cubes", "aggregate & resample" @@ -9,10 +9,19 @@ "parameters": [ { "name": "data", - "description": "A raster data cube.\n\nThe data cube must have been reduced to only contain two spatial dimensions and a third dimension the values are aggregated for, for example the temporal dimension to get a time series. Otherwise, this process fails with the `TooManyDimensions` exception.\n\nThe data cube implicitly gets restricted to the bounds of the geometries as if ``filter_spatial()`` would have been used with the same values for the corresponding parameters immediately before this process.", + "description": "A raster data cube with at least two spatial dimensions.\n\nThe data cube implicitly gets restricted to the bounds of the geometries as if ``filter_spatial()`` would have been used with the same values for the corresponding parameters immediately before this process.", "schema": { "type": "object", - "subtype": "raster-cube" + "subtype": "datacube", + "dimensions": [ + { + "type": "spatial", + "axis": [ + "x", + "y" + ] + } + ] } }, { @@ -60,11 +69,14 @@ }, { "name": "target_dimension", - "description": "The name of a new dimensions that is used to store the results. A new dimension will be created with the given name and type `other` (see ``add_dimension()``). Defaults to the dimension name `result`. Fails with a `TargetDimensionExists` exception if a dimension with the specified name exists.", + "description": "By default (which is `null`), the process only computes the results and doesn't add a new dimension. If this parameter contains a new dimension name, the computation also stores information about the total count of pixels (valid + invalid pixels) and the number of valid pixels (see ``is_valid()``) for each computed value. These values are added as a new dimension. The new dimension of type `other` has the dimension labels `value`, `total_count` and `valid_count`.", "schema": { - "type": "string" + "type": [ + "string", + "null" + ] }, - "default": "result", + "default": null, "optional": true }, { @@ -78,16 +90,18 @@ } ], "returns": { - "description": "A vector data cube with the computed results and restricted to the bounds of the geometries.\n\nThe computed value is used for the dimension with the name that was specified in the parameter `target_dimension`.\n\nThe computation also stores information about the total count of pixels (valid + invalid pixels) and the number of valid pixels (see ``is_valid()``) for each geometry. These values are added as a new dimension with a dimension name derived from `target_dimension` by adding the suffix `_meta`. The new dimension has the dimension labels `total_count` and `valid_count`.", + "description": "A vector data cube with the computed results and restricted to the bounds of the geometries. The spatial dimensions is replaced by a vector dimension and if `target_dimension` is not `null`, a new dimension is added.", "schema": { "type": "object", - "subtype": "vector-cube" + "subtype": "datacube", + "dimensions": [ + { + "type": "vector" + } + ] } }, "exceptions": { - "TooManyDimensions": { - "message": "The number of dimensions must be reduced to three for `aggregate_spatial`." - }, "TargetDimensionExists": { "message": "A dimension with the specified target dimension name already exists." } diff --git a/aggregate_temporal.json b/aggregate_temporal.json index b68b366c..d63099b7 100644 --- a/aggregate_temporal.json +++ b/aggregate_temporal.json @@ -12,7 +12,12 @@ "description": "A data cube.", "schema": { "type": "object", - "subtype": "raster-cube" + "subtype": "datacube", + "dimensions": [ + { + "type": "temporal" + } + ] } }, { @@ -162,7 +167,12 @@ "description": "A new data cube with the same dimensions. The dimension properties (name, type, labels, reference system and resolution) remain unchanged, except for the resolution and dimension labels of the given temporal dimension.", "schema": { "type": "object", - "subtype": "raster-cube" + "subtype": "datacube", + "dimensions": [ + { + "type": "temporal" + } + ] } }, "examples": [ @@ -234,4 +244,4 @@ "title": "Aggregation explained in the openEO documentation" } ] -} \ No newline at end of file +} diff --git a/aggregate_temporal_period.json b/aggregate_temporal_period.json index 832e72aa..ce6ec410 100644 --- a/aggregate_temporal_period.json +++ b/aggregate_temporal_period.json @@ -13,7 +13,12 @@ "description": "The source data cube.", "schema": { "type": "object", - "subtype": "raster-cube" + "subtype": "datacube", + "dimensions": [ + { + "type": "temporal" + } + ] } }, { @@ -97,7 +102,12 @@ "description": "A new data cube with the same dimensions. The dimension properties (name, type, labels, reference system and resolution) remain unchanged, except for the resolution and dimension labels of the given temporal dimension. The specified temporal dimension has the following dimension labels (`YYYY` = four-digit year, `MM` = two-digit month, `DD` two-digit day of month):\n\n* `hour`: `YYYY-MM-DD-00` - `YYYY-MM-DD-23`\n* `day`: `YYYY-001` - `YYYY-365`\n* `week`: `YYYY-01` - `YYYY-52`\n* `dekad`: `YYYY-00` - `YYYY-36`\n* `month`: `YYYY-01` - `YYYY-12`\n* `season`: `YYYY-djf` (December - February), `YYYY-mam` (March - May), `YYYY-jja` (June - August), `YYYY-son` (September - November).\n* `tropical-season`: `YYYY-ndjfma` (November - April), `YYYY-mjjaso` (May - October).\n* `year`: `YYYY`\n* `decade`: `YYY0`\n* `decade-ad`: `YYY1`\n\nThe dimension labels in the new data cube are complete for the whole extent of the source data cube. For example, if `period` is set to `day` and the source data cube has two dimension labels at the beginning of the year (`2020-01-01`) and the end of a year (`2020-12-31`), the process returns a data cube with 365 dimension labels (`2020-001`, `2020-002`, ..., `2020-365`). In contrast, if `period` is set to `day` and the source data cube has just one dimension label `2020-01-05`, the process returns a data cube with just a single dimension label (`2020-005`).", "schema": { "type": "object", - "subtype": "raster-cube" + "subtype": "datacube", + "dimensions": [ + { + "type": "temporal" + } + ] } }, "exceptions": { @@ -118,4 +128,4 @@ "title": "Aggregation explained in the openEO documentation" } ] -} \ No newline at end of file +} diff --git a/anomaly.json b/anomaly.json index 3f369087..7a3890b7 100644 --- a/anomaly.json +++ b/anomaly.json @@ -13,7 +13,12 @@ "description": "A data cube with exactly one temporal dimension and the following dimension labels for the given period (`YYYY` = four-digit year, `MM` = two-digit month, `DD` two-digit day of month):\n\n* `hour`: `YYYY-MM-DD-00` - `YYYY-MM-DD-23`\n* `day`: `YYYY-001` - `YYYY-365`\n* `week`: `YYYY-01` - `YYYY-52`\n* `dekad`: `YYYY-00` - `YYYY-36`\n* `month`: `YYYY-01` - `YYYY-12`\n* `season`: `YYYY-djf` (December - February), `YYYY-mam` (March - May), `YYYY-jja` (June - August), `YYYY-son` (September - November).\n* `tropical-season`: `YYYY-ndjfma` (November - April), `YYYY-mjjaso` (May - October).\n* `year`: `YYYY`\n* `decade`: `YYY0`\n* `decade-ad`: `YYY1`\n* `single-period` / `climatology-period`: Any\n\n``aggregate_temporal_period()`` can compute such a data cube.", "schema": { "type": "object", - "subtype": "raster-cube" + "subtype": "datacube", + "dimensions": [ + { + "type": "temporal" + } + ] } }, { @@ -21,7 +26,12 @@ "description": "A data cube with normals, e.g. daily, monthly or yearly values computed from a process such as ``climatological_normal()``. Must contain exactly one temporal dimension with the following dimension labels for the given period:\n\n* `hour`: `00` - `23`\n* `day`: `001` - `365`\n* `week`: `01` - `52`\n* `dekad`: `00` - `36`\n* `month`: `01` - `12`\n* `season`: `djf` (December - February), `mam` (March - May), `jja` (June - August), `son` (September - November)\n* `tropical-season`: `ndjfma` (November - April), `mjjaso` (May - October)\n* `year`: Four-digit year numbers\n* `decade`: Four-digit year numbers, the last digit being a `0`\n* `decade-ad`: Four-digit year numbers, the last digit being a `1`\n* `single-period` / `climatology-period`: A single dimension label with any name is expected.", "schema": { "type": "object", - "subtype": "raster-cube" + "subtype": "datacube", + "dimensions": [ + { + "type": "temporal" + } + ] } }, { @@ -50,7 +60,12 @@ "description": "A data cube with the same dimensions. The dimension properties (name, type, labels, reference system and resolution) remain unchanged.", "schema": { "type": "object", - "subtype": "raster-cube" + "subtype": "datacube", + "dimensions": [ + { + "type": "temporal" + } + ] } } } diff --git a/apply.json b/apply.json index d0be1e1d..20995c88 100644 --- a/apply.json +++ b/apply.json @@ -1,7 +1,7 @@ { "id": "apply", - "summary": "Apply a process to each pixel", - "description": "Applies a process to each pixel value in the data cube (i.e. a local operation). In contrast, the process ``apply_dimension()`` applies a process to all pixel values along a particular dimension.", + "summary": "Apply a process to each value", + "description": "Applies a process to each value in the data cube (i.e. a local operation). In contrast, the process ``apply_dimension()`` applies a process to all values along a particular dimension.", "categories": [ "cubes" ], @@ -11,7 +11,7 @@ "description": "A data cube.", "schema": { "type": "object", - "subtype": "raster-cube" + "subtype": "datacube" } }, { @@ -60,7 +60,7 @@ "description": "A data cube with the newly computed values and the same dimensions. The dimension properties (name, type, labels, reference system and resolution) remain unchanged.", "schema": { "type": "object", - "subtype": "raster-cube" + "subtype": "datacube" } }, "links": [ diff --git a/apply_dimension.json b/apply_dimension.json index 796393f4..5f9a984a 100644 --- a/apply_dimension.json +++ b/apply_dimension.json @@ -1,7 +1,7 @@ { "id": "apply_dimension", - "summary": "Apply a process to pixels along a dimension", - "description": "Applies a process to all pixel values along a dimension of a raster data cube. For example, if the temporal dimension is specified the process will work on a time series of pixel values.\n\nThe process ``reduce_dimension()`` also applies a process to pixel values along a dimension, but drops the dimension afterwards. The process ``apply()`` applies a process to each pixel value in the data cube.\n\nThe target dimension is the source dimension if not specified otherwise in the `target_dimension` parameter. The pixel values in the target dimension get replaced by the computed pixel values. The name, type and reference system are preserved.\n\nThe dimension labels are preserved when the target dimension is the source dimension and the number of pixel values in the source dimension is equal to the number of values computed by the process. Otherwise, the dimension labels will be incrementing integers starting from zero, which can be changed using ``rename_labels()`` afterwards. The number of labels will equal to the number of values computed by the process.", + "summary": "Apply a process to all values along a dimension", + "description": "Applies a process to all values along a dimension of a data cube. For example, if the temporal dimension is specified the process will work on the values of a time series.\n\nThe process ``reduce_dimension()`` also applies a process to values along a dimension, but drops the dimension afterwards. The process ``apply()`` applies a process to each value in the data cube.\n\nThe target dimension is the source dimension if not specified otherwise in the `target_dimension` parameter. The values in the target dimension get replaced by the computed values. The name, type and reference system are preserved.\n\nThe dimension labels are preserved when the target dimension is the source dimension and the number of values in the source dimension is equal to the number of values computed by the process. Otherwise, the dimension labels will be incrementing integers starting from zero, which can be changed using ``rename_labels()`` afterwards. The number of labels will equal to the number of values computed by the process.", "categories": [ "cubes" ], @@ -11,12 +11,12 @@ "description": "A data cube.", "schema": { "type": "object", - "subtype": "raster-cube" + "subtype": "datacube" } }, { "name": "process", - "description": "Process to be applied on all pixel values. The specified process needs to accept an array and must return an array with at least one element. A process may consist of multiple sub-processes.", + "description": "Process to be applied on all values along the given dimension. The specified process needs to accept an array and must return an array with at least one element. A process may consist of multiple sub-processes.", "schema": { "type": "object", "subtype": "process-graph", @@ -83,10 +83,10 @@ } ], "returns": { - "description": "A data cube with the newly computed values.\n\nAll dimensions stay the same, except for the dimensions specified in corresponding parameters. There are three cases how the dimensions can change:\n\n1. The source dimension is the target dimension:\n - The (number of) dimensions remain unchanged as the source dimension is the target dimension.\n - The source dimension properties name and type remain unchanged.\n - The dimension labels, the reference system and the resolution are preserved only if the number of pixel values in the source dimension is equal to the number of values computed by the process. Otherwise, all other dimension properties change as defined in the list below.\n2. The source dimension is not the target dimension and the latter exists:\n - The number of dimensions decreases by one as the source dimension is dropped.\n - The target dimension properties name and type remain unchanged. All other dimension properties change as defined in the list below.\n3. The source dimension is not the target dimension and the latter does not exist:\n - The number of dimensions remain unchanged, but the source dimension is replaced with the target dimension.\n - The target dimension has the specified name and the type other. All other dimension properties are set as defined in the list below.\n\nUnless otherwise stated above, for the given (target) dimension the following applies:\n\n- the number of dimension labels is equal to the number of values computed by the process,\n- the dimension labels are incrementing integers starting from zero,\n- the resolution changes, and\n- the reference system is undefined.", + "description": "A data cube with the newly computed values.\n\nAll dimensions stay the same, except for the dimensions specified in corresponding parameters. There are three cases how the dimensions can change:\n\n1. The source dimension is the target dimension:\n - The (number of) dimensions remain unchanged as the source dimension is the target dimension.\n - The source dimension properties name and type remain unchanged.\n - The dimension labels, the reference system and the resolution are preserved only if the number of values in the source dimension is equal to the number of values computed by the process. Otherwise, all other dimension properties change as defined in the list below.\n2. The source dimension is not the target dimension and the latter exists:\n - The number of dimensions decreases by one as the source dimension is dropped.\n - The target dimension properties name and type remain unchanged. All other dimension properties change as defined in the list below.\n3. The source dimension is not the target dimension and the latter does not exist:\n - The number of dimensions remain unchanged, but the source dimension is replaced with the target dimension.\n - The target dimension has the specified name and the type other. All other dimension properties are set as defined in the list below.\n\nUnless otherwise stated above, for the given (target) dimension the following applies:\n\n- the number of dimension labels is equal to the number of values computed by the process,\n- the dimension labels are incrementing integers starting from zero,\n- the resolution changes, and\n- the reference system is undefined.", "schema": { "type": "object", - "subtype": "raster-cube" + "subtype": "datacube" } }, "exceptions": { @@ -101,4 +101,4 @@ "title": "Apply explained in the openEO documentation" } ] -} \ No newline at end of file +} diff --git a/apply_kernel.json b/apply_kernel.json index 20d940c2..cf16dc78 100644 --- a/apply_kernel.json +++ b/apply_kernel.json @@ -1,7 +1,7 @@ { "id": "apply_kernel", "summary": "Apply a spatial convolution with a kernel", - "description": "Applies a 2D convolution (i.e. a focal operation with a weighted kernel) on the horizontal spatial dimensions (axes `x` and `y`) of the data cube.\n\nEach value in the kernel is multiplied with the corresponding pixel value and all products are summed up afterwards. The sum is then multiplied with the factor.\n\nThe process can't handle non-numerical or infinite numerical values in the data cube. Boolean values are converted to integers (`false` = 0, `true` = 1), but all other non-numerical or infinite values are replaced with zeroes by default (see parameter `replace_invalid`).\n\nFor cases requiring more generic focal operations or non-numerical values, see ``apply_neighborhood()``.", + "description": "Applies a 2D convolution (i.e. a focal operation with a weighted kernel) on the horizontal spatial dimensions (axes `x` and `y`) of a raster data cube.\n\nEach value in the kernel is multiplied with the corresponding pixel value and all products are summed up afterwards. The sum is then multiplied with the factor.\n\nThe process can't handle non-numerical or infinite numerical values in the data cube. Boolean values are converted to integers (`false` = 0, `true` = 1), but all other non-numerical or infinite values are replaced with zeroes by default (see parameter `replace_invalid`).\n\nFor cases requiring more generic focal operations or non-numerical values, see ``apply_neighborhood()``.", "categories": [ "cubes", "math > image filter" @@ -9,10 +9,19 @@ "parameters": [ { "name": "data", - "description": "A data cube.", + "description": "A raster data cube.", "schema": { "type": "object", - "subtype": "raster-cube" + "subtype": "datacube", + "dimensions": [ + { + "type": "spatial", + "axis": [ + "x", + "y" + ] + } + ] } }, { @@ -73,7 +82,16 @@ "description": "A data cube with the newly computed values and the same dimensions. The dimension properties (name, type, labels, reference system and resolution) remain unchanged.", "schema": { "type": "object", - "subtype": "raster-cube" + "subtype": "datacube", + "dimensions": [ + { + "type": "spatial", + "axis": [ + "x", + "y" + ] + } + ] } }, "exceptions": { diff --git a/apply_neighborhood.json b/apply_neighborhood.json index 4966f28e..3b89adf4 100644 --- a/apply_neighborhood.json +++ b/apply_neighborhood.json @@ -8,10 +8,19 @@ "parameters": [ { "name": "data", - "description": "A data cube.", + "description": "A raster data cube.", "schema": { "type": "object", - "subtype": "raster-cube" + "subtype": "datacube", + "dimensions": [ + { + "type": "spatial", + "axis": [ + "x", + "y" + ] + } + ] } }, { @@ -23,10 +32,19 @@ "parameters": [ { "name": "data", - "description": "A subset of the data cube as specified in `context` and `overlap`.", + "description": "A subset of the data cube as specified in `size` and `overlap`.", "schema": { "type": "object", - "subtype": "raster-cube" + "subtype": "datacube", + "dimensions": [ + { + "type": "spatial", + "axis": [ + "x", + "y" + ] + } + ] } }, { @@ -43,7 +61,16 @@ "description": "The data cube with the newly computed values and the same dimensions. The dimension properties (name, type, labels, reference system and resolution) must remain unchanged, otherwise a `DataCubePropertiesImmutable` exception will be thrown.", "schema": { "type": "object", - "subtype": "raster-cube" + "subtype": "datacube", + "dimensions": [ + { + "type": "spatial", + "axis": [ + "x", + "y" + ] + } + ] } } } @@ -184,10 +211,19 @@ } ], "returns": { - "description": "A data cube with the newly computed values and the same dimensions. The dimension properties (name, type, labels, reference system and resolution) remain unchanged.", + "description": "A raster data cube with the newly computed values and the same dimensions. The dimension properties (name, type, labels, reference system and resolution) remain unchanged.", "schema": { "type": "object", - "subtype": "raster-cube" + "subtype": "datacube", + "dimensions": [ + { + "type": "spatial", + "axis": [ + "x", + "y" + ] + } + ] } }, "examples": [ diff --git a/climatological_normal.json b/climatological_normal.json index 33cd2d60..e1b1e0c9 100644 --- a/climatological_normal.json +++ b/climatological_normal.json @@ -12,7 +12,12 @@ "description": "A data cube with exactly one temporal dimension. The data cube must span at least the temporal interval specified in the parameter `climatology-period`.\n\nSeasonal periods may span two consecutive years, e.g. temporal winter that includes months December, January and February. If the required months before the actual climate period are available, the season is taken into account. If not available, the first season is not taken into account and the seasonal mean is based on one year less than the other seasonal normals. The incomplete season at the end of the last year is never taken into account.", "schema": { "type": "object", - "subtype": "raster-cube" + "subtype": "datacube", + "dimensions": [ + { + "type": "temporal" + } + ] } }, { @@ -56,7 +61,12 @@ "description": "A data cube with the same dimensions. The dimension properties (name, type, labels, reference system and resolution) remain unchanged, except for the resolution and dimension labels of the temporal dimension. The temporal dimension has the following dimension labels:\n\n* `day`: `001` - `365`\n* `month`: `01` - `12`\n* `climatology-period`: `climatology-period`\n* `season`: `djf` (December - February), `mam` (March - May), `jja` (June - August), `son` (September - November)\n* `tropical-season`: `ndjfma` (November - April), `mjjaso` (May - October)", "schema": { "type": "object", - "subtype": "raster-cube" + "subtype": "datacube", + "dimensions": [ + { + "type": "temporal" + } + ] } }, "links": [ diff --git a/create_raster_cube.json b/create_data_cube.json similarity index 53% rename from create_raster_cube.json rename to create_data_cube.json index 576728ee..55f0aede 100644 --- a/create_raster_cube.json +++ b/create_data_cube.json @@ -1,16 +1,16 @@ { - "id": "create_raster_cube", - "summary": "Create an empty raster data cube", - "description": "Creates a new raster data cube without dimensions. Dimensions can be added with ``add_dimension()``.", + "id": "create_data_cube", + "summary": "Create an empty data cube", + "description": "Creates a new data cube without dimensions. Dimensions can be added with ``add_dimension()``.", "categories": [ "cubes" ], "parameters": [], "returns": { - "description": "An empty raster data cube with zero dimensions.", + "description": "An empty data cube with no dimensions.", "schema": { "type": "object", - "subtype": "raster-cube" + "subtype": "datacube" } }, "links": [ @@ -20,4 +20,4 @@ "title": "Data Cubes explained in the openEO documentation" } ] -} \ No newline at end of file +} diff --git a/dimension_labels.json b/dimension_labels.json index 37a5908d..15c5ba0f 100644 --- a/dimension_labels.json +++ b/dimension_labels.json @@ -11,7 +11,7 @@ "description": "The data cube.", "schema": { "type": "object", - "subtype": "raster-cube" + "subtype": "datacube" } }, { @@ -39,4 +39,4 @@ "message": "A dimension with the specified name does not exist." } } -} \ No newline at end of file +} diff --git a/drop_dimension.json b/drop_dimension.json index 90212dd9..eaee1d4c 100644 --- a/drop_dimension.json +++ b/drop_dimension.json @@ -11,7 +11,7 @@ "description": "The data cube to drop a dimension from.", "schema": { "type": "object", - "subtype": "raster-cube" + "subtype": "datacube" } }, { @@ -26,7 +26,7 @@ "description": "A data cube without the specified dimension. The number of dimensions decreases by one, but the dimension properties (name, type, labels, reference system and resolution) for all other dimensions remain unchanged.", "schema": { "type": "object", - "subtype": "raster-cube" + "subtype": "datacube" } }, "exceptions": { @@ -37,4 +37,4 @@ "message": "A dimension with the specified name does not exist." } } -} \ No newline at end of file +} diff --git a/filter_bands.json b/filter_bands.json index ee9c9aae..24ccf023 100644 --- a/filter_bands.json +++ b/filter_bands.json @@ -12,7 +12,12 @@ "description": "A data cube with bands.", "schema": { "type": "object", - "subtype": "raster-cube" + "subtype": "datacube", + "dimensions": [ + { + "type": "bands" + } + ] } }, { @@ -62,7 +67,12 @@ "description": "A data cube limited to a subset of its original bands. The dimensions and dimension properties (name, type, labels, reference system and resolution) remain unchanged, except that the dimension of type `bands` has less (or the same) dimension labels.", "schema": { "type": "object", - "subtype": "raster-cube" + "subtype": "datacube", + "dimensions": [ + { + "type": "bands" + } + ] } }, "exceptions": { @@ -85,4 +95,4 @@ "title": "Filters explained in the openEO documentation" } ] -} \ No newline at end of file +} diff --git a/filter_bbox.json b/filter_bbox.json index 8cc2103a..7e823b09 100644 --- a/filter_bbox.json +++ b/filter_bbox.json @@ -12,7 +12,19 @@ "description": "A data cube.", "schema": { "type": "object", - "subtype": "raster-cube" + "subtype": "datacube", + "dimensions": [ + { + "type": "spatial", + "axis": [ + "x", + "y" + ] + }, + { + "type": "vector" + } + ] } }, { @@ -94,7 +106,19 @@ "description": "A data cube restricted to the bounding box. The dimensions and dimension properties (name, type, labels, reference system and resolution) remain unchanged, except that the spatial dimensions have less (or the same) dimension labels.", "schema": { "type": "object", - "subtype": "raster-cube" + "subtype": "datacube", + "dimensions": [ + { + "type": "spatial", + "axis": [ + "x", + "y" + ] + }, + { + "type": "vector" + } + ] } }, "links": [ @@ -124,4 +148,4 @@ "title": "Simple Features standard by the OGC" } ] -} \ No newline at end of file +} diff --git a/filter_spatial.json b/filter_spatial.json index b807b8df..9c7a95a7 100644 --- a/filter_spatial.json +++ b/filter_spatial.json @@ -12,7 +12,19 @@ "description": "A data cube.", "schema": { "type": "object", - "subtype": "raster-cube" + "subtype": "datacube", + "dimensions": [ + { + "type": "spatial", + "axis": [ + "x", + "y" + ] + }, + { + "type": "vector" + } + ] } }, { @@ -28,7 +40,19 @@ "description": "A data cube restricted to the specified geometries. The dimensions and dimension properties (name, type, labels, reference system and resolution) remain unchanged, except that the spatial dimensions have less (or the same) dimension labels.", "schema": { "type": "object", - "subtype": "raster-cube" + "subtype": "datacube", + "dimensions": [ + { + "type": "spatial", + "axis": [ + "x", + "y" + ] + }, + { + "type": "vector" + } + ] } }, "links": [ @@ -43,4 +67,4 @@ "title": "Simple Features standard by the OGC" } ] -} \ No newline at end of file +} diff --git a/filter_temporal.json b/filter_temporal.json index bd7ea0b3..0ba2274e 100644 --- a/filter_temporal.json +++ b/filter_temporal.json @@ -12,7 +12,12 @@ "description": "A data cube.", "schema": { "type": "object", - "subtype": "raster-cube" + "subtype": "datacube", + "dimensions": [ + { + "type": "temporal" + } + ] } }, { @@ -76,7 +81,12 @@ "description": "A data cube restricted to the specified temporal extent. The dimensions and dimension properties (name, type, labels, reference system and resolution) remain unchanged, except that the temporal dimensions (determined by `dimensions` parameter) may have less dimension labels.", "schema": { "type": "object", - "subtype": "raster-cube" + "subtype": "datacube", + "dimensions": [ + { + "type": "temporal" + } + ] } }, "exceptions": { diff --git a/load_collection.json b/load_collection.json index 160888be..1779361d 100644 --- a/load_collection.json +++ b/load_collection.json @@ -1,7 +1,7 @@ { "id": "load_collection", "summary": "Load a collection", - "description": "Loads a collection from the current back-end by its id and returns it as a processable data cube. The data that is added to the data cube can be restricted with the parameters `spatial_extent`, `temporal_extent`, `bands` and `properties`. If no data is available for the given extents, a `NoDataAvailable` exception is thrown.\n\n**Remarks:**\n\n* The bands (and all dimensions that specify nominal dimension labels) are expected to be ordered as specified in the metadata if the `bands` parameter is set to `null`.\n* If no additional parameter is specified this would imply that the whole data set is expected to be loaded. Due to the large size of many data sets, this is not recommended and may be optimized by back-ends to only load the data that is actually required after evaluating subsequent processes such as filters. This means that the pixel values should be processed only after the data has been limited to the required extent and as a consequence also to a manageable size.", + "description": "Loads a collection from the current back-end by its id and returns it as a processable data cube. The data that is added to the data cube can be restricted with the parameters `spatial_extent`, `temporal_extent`, `bands` and `properties`. If no data is available for the given extents, a `NoDataAvailable` exception is thrown.\n\n**Remarks:**\n\n* The bands (and all dimensions that specify nominal dimension labels) are expected to be ordered as specified in the metadata if the `bands` parameter is set to `null`.\n* If no additional parameter is specified this would imply that the whole data set is expected to be loaded. Due to the large size of many data sets, this is not recommended and may be optimized by back-ends to only load the data that is actually required after evaluating subsequent processes such as filters. This means that the values in the data cube should be processed only after the data has been limited to the required extent and as a consequence also to a manageable size.", "categories": [ "cubes", "import" @@ -18,7 +18,7 @@ }, { "name": "spatial_extent", - "description": "Limits the data to load from the collection to the specified bounding box or polygons.\n\nThe process puts a pixel into the data cube if the point at the pixel center intersects with the bounding box or any of the polygons (as defined in the Simple Features standard by the OGC).\n\nThe GeoJSON can be one of the following feature types:\n\n* A `Polygon` or `MultiPolygon` geometry,\n* a `Feature` with a `Polygon` or `MultiPolygon` geometry,\n* a `FeatureCollection` containing at least one `Feature` with `Polygon` or `MultiPolygon` geometries, or\n* a `GeometryCollection` containing `Polygon` or `MultiPolygon` geometries. To maximize interoperability, `GeometryCollection` should be avoided in favour of one of the alternatives above.\n\nSet this parameter to `null` to set no limit for the spatial extent. Be careful with this when loading large datasets! It is recommended to use this parameter instead of using ``filter_bbox()`` or ``filter_spatial()`` directly after loading unbounded data.", + "description": "Limits the data to load from the collection to the specified bounding box or polygons.\n\nThe process puts the corresponding value into the data cube if the point at the pixel center intersects with the bounding box or any of the polygons (as defined in the Simple Features standard by the OGC).\n\nThe GeoJSON can be one of the following feature types:\n\n* A `Polygon` or `MultiPolygon` geometry,\n* a `Feature` with a `Polygon` or `MultiPolygon` geometry,\n* a `FeatureCollection` containing at least one `Feature` with `Polygon` or `MultiPolygon` geometries, or\n* a `GeometryCollection` containing `Polygon` or `MultiPolygon` geometries. To maximize interoperability, `GeometryCollection` should be avoided in favour of one of the alternatives above.\n\nSet this parameter to `null` to set no limit for the spatial extent. Be careful with this when loading large datasets! It is recommended to use this parameter instead of using ``filter_bbox()`` or ``filter_spatial()`` directly after loading unbounded data.", "schema": [ { "title": "Bounding Box", @@ -219,7 +219,7 @@ "description": "A data cube for further processing. The dimensions and dimension properties (name, type, labels, reference system and resolution) correspond to the collection's metadata, but the dimension labels are restricted as specified in the parameters.", "schema": { "type": "object", - "subtype": "raster-cube" + "subtype": "datacube" } }, "exceptions": { diff --git a/mask_polygon.json b/mask_polygon.json index c1f59d4e..01f3bd38 100644 --- a/mask_polygon.json +++ b/mask_polygon.json @@ -12,7 +12,16 @@ "description": "A raster data cube.", "schema": { "type": "object", - "subtype": "raster-cube" + "subtype": "datacube", + "dimensions": [ + { + "type": "spatial", + "axis": [ + "x", + "y" + ] + } + ] } }, { @@ -57,7 +66,16 @@ "description": "A masked raster data cube with the same dimensions. The dimension properties (name, type, labels, reference system and resolution) remain unchanged.", "schema": { "type": "object", - "subtype": "raster-cube" + "subtype": "datacube", + "dimensions": [ + { + "type": "spatial", + "axis": [ + "x", + "y" + ] + } + ] } }, "links": [ @@ -67,4 +85,4 @@ "title": "Simple Features standard by the OGC" } ] -} \ No newline at end of file +} diff --git a/meta/subtype-schemas.json b/meta/subtype-schemas.json index 3dc15b36..f6d261ee 100644 --- a/meta/subtype-schemas.json +++ b/meta/subtype-schemas.json @@ -112,6 +112,12 @@ "description": "A collection identifier from the list of supported collections.", "pattern": "^[\\w\\-\\.~/]+$" }, + "datacube": { + "type": "object", + "subtype": "datacube", + "title": "Data Cube", + "description": "A data cube that consists of an arbitrary number of dimensions and doesn't require any dimension type specifically." + }, "date": { "type": "string", "subtype": "date", @@ -290,7 +296,8 @@ "type": "object", "subtype": "raster-cube", "title": "Raster data cube", - "description": "A raster data cube, an image collection stored at the back-end. Different back-ends have different internal representations for this data structure." + "description": "A vector data cube, which is a data cube with two dimension of type spatial (x and y). This has been deprecated in favour of `datacube`.", + "deprecated": true }, "temporal-interval": { "type": "array", @@ -417,7 +424,8 @@ "type": "object", "subtype": "vector-cube", "title": "Vector data cube", - "description": "A vector data cube, a vector collection stored at the back-end. Different back-ends have different internal representations for this data structure" + "description": "A vector data cube, which is a data cube with a dimension of type vector. This has been deprecated in favour of `datacube`.", + "deprecated": true }, "wkt2-definition": { "type": "string", diff --git a/ndvi.json b/ndvi.json index e86a27e6..5bb952d4 100644 --- a/ndvi.json +++ b/ndvi.json @@ -13,7 +13,19 @@ "description": "A raster data cube with two bands that have the common names `red` and `nir` assigned.", "schema": { "type": "object", - "subtype": "raster-cube" + "subtype": "datacube", + "dimensions": [ + { + "type": "spatial", + "axis": [ + "x", + "y" + ] + }, + { + "type": "bands" + } + ] } }, { @@ -56,7 +68,16 @@ "description": "A raster data cube containing the computed NDVI values. The structure of the data cube differs depending on the value passed to `target_band`:\n\n* `target_band` is `null`: The data cube does not contain the dimension of type `bands`, the number of dimensions decreases by one. The dimension properties (name, type, labels, reference system and resolution) for all other dimensions remain unchanged.\n* `target_band` is a string: The data cube keeps the same dimensions. The dimension properties remain unchanged, but the number of dimension labels for the dimension of type `bands` increases by one. The additional label is named as specified in `target_band`.", "schema": { "type": "object", - "subtype": "raster-cube" + "subtype": "datacube", + "dimensions": [ + { + "type": "spatial", + "axis": [ + "x", + "y" + ] + } + ] } }, "exceptions": { diff --git a/proposals/aggregate_spatial_window.json b/proposals/aggregate_spatial_window.json index 77230275..5bc3e03c 100644 --- a/proposals/aggregate_spatial_window.json +++ b/proposals/aggregate_spatial_window.json @@ -13,7 +13,16 @@ "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" + "subtype": "datacube", + "dimensions": [ + { + "type": "spatial", + "axis": [ + "x", + "y" + ] + } + ] } }, { @@ -103,10 +112,19 @@ } ], "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.", + "description": "A raster 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" + "subtype": "datacube", + "dimensions": [ + { + "type": "spatial", + "axis": [ + "x", + "y" + ] + } + ] } }, "links": [ @@ -116,4 +134,4 @@ "title": "Aggregation explained in the openEO documentation" } ] -} \ No newline at end of file +} diff --git a/proposals/ard_normalized_radar_backscatter.json b/proposals/ard_normalized_radar_backscatter.json index e643845f..ec60de44 100644 --- a/proposals/ard_normalized_radar_backscatter.json +++ b/proposals/ard_normalized_radar_backscatter.json @@ -13,8 +13,20 @@ "name": "data", "description": "The source data cube containing SAR input.", "schema": { - "subtype": "raster-cube", - "type": "object" + "type": "object", + "subtype": "datacube", + "dimensions": [ + { + "type": "spatial", + "axis": [ + "x", + "y" + ] + }, + { + "type": "bands" + } + ] } }, { @@ -73,8 +85,20 @@ "returns": { "description": "Backscatter values expressed as gamma0 in linear scale.\n\nIn addition to the bands `contributing_area` and `ellipsoid_incidence_angle` that can optionally be added with corresponding parameters, the following bands are always added to the data cube:\n\n- `mask`: A data mask that indicates which values are valid (1), invalid (0) or contain no-data (null).\n- `local_incidence_angle`: A band with DEM-based local incidence angles in degrees.\n\nThe data returned is CARD4L compliant with corresponding metadata.", "schema": { - "subtype": "raster-cube", - "type": "object" + "type": "object", + "subtype": "datacube", + "dimensions": [ + { + "type": "spatial", + "axis": [ + "x", + "y" + ] + }, + { + "type": "bands" + } + ] } }, "exceptions": { @@ -128,4 +152,4 @@ "result": true } } -} \ No newline at end of file +} diff --git a/proposals/ard_surface_reflectance.json b/proposals/ard_surface_reflectance.json index 38aa758b..01328f10 100644 --- a/proposals/ard_surface_reflectance.json +++ b/proposals/ard_surface_reflectance.json @@ -13,8 +13,20 @@ "description": "The source data cube containing multi-spectral optical top of the atmosphere (TOA) reflectances. There must be a single dimension of type `bands` available.", "name": "data", "schema": { - "subtype": "raster-cube", - "type": "object" + "type": "object", + "subtype": "datacube", + "dimensions": [ + { + "type": "spatial", + "axis": [ + "x", + "y" + ] + }, + { + "type": "bands" + } + ] } }, { @@ -83,8 +95,20 @@ "returns": { "description": "Data cube containing bottom of atmosphere reflectances for each spectral band in the source data cube, with atmospheric disturbances like clouds and cloud shadows removed. No-data values (null) are directly set in the bands. Depending on the methods used, several additional bands will be added to the data cube:\n\nData cube containing bottom of atmosphere reflectances for each spectral band in the source data cube, with atmospheric disturbances like clouds and cloud shadows removed. Depending on the methods used, several additional bands will be added to the data cube:\n\n- `date` (optional): Specifies per-pixel acquisition timestamps.\n- `incomplete-testing` (required): Identifies pixels with a value of 1 for which the per-pixel tests (at least saturation, cloud and cloud shadows, see CARD4L specification for details) have not all been successfully completed. Otherwise, the value is 0.\n- `saturation` (required) / `saturation_{band}` (optional): Indicates where pixels in the input spectral bands are saturated (1) or not (0). If the saturation is given per band, the band names are `saturation_{band}` with `{band}` being the band name from the source data cube.\n- `cloud`, `shadow` (both required),`aerosol`, `haze`, `ozone`, `water_vapor` (all optional): Indicates the probability of pixels being an atmospheric disturbance such as clouds. All bands have values between 0 (clear) and 1, which describes the probability that it is an atmospheric disturbance.\n- `snow-ice` (optional): Points to a file that indicates whether a pixel is assessed as being snow/ice (1) or not (0). All values describe the probability and must be between 0 and 1.\n- `land-water` (optional): Indicates whether a pixel is assessed as being land (1) or water (0). All values describe the probability and must be between 0 and 1.\n- `incidence-angle` (optional): Specifies per-pixel incidence angles in degrees.\n- `azimuth` (optional): Specifies per-pixel azimuth angles in degrees.\n- `sun-azimuth:` (optional): Specifies per-pixel sun azimuth angles in degrees.\n- `sun-elevation` (optional): Specifies per-pixel sun elevation angles in degrees.\n- `terrain-shadow` (optional): Indicates with a value of 1 whether a pixel is not directly illuminated due to terrain shadowing. Otherwise, the value is 0.\n- `terrain-occlusion` (optional): Indicates with a value of 1 whether a pixel is not visible to the sensor due to terrain occlusion during off-nadir viewing. Otherwise, the value is 0.\n- `terrain-illumination` (optional): Contains coefficients used for terrain illumination correction are provided for each pixel.\n\nThe data returned is CARD4L compliant with corresponding metadata.", "schema": { - "subtype": "raster-cube", - "type": "object" + "type": "object", + "subtype": "datacube", + "dimensions": [ + { + "type": "spatial", + "axis": [ + "x", + "y" + ] + }, + { + "type": "bands" + } + ] } }, "links": [ @@ -94,4 +118,4 @@ "title": "CEOS CARD4L specification" } ] -} \ No newline at end of file +} diff --git a/proposals/atmospheric_correction.json b/proposals/atmospheric_correction.json index 9b537322..d366f1ed 100644 --- a/proposals/atmospheric_correction.json +++ b/proposals/atmospheric_correction.json @@ -12,8 +12,20 @@ "description": "Data cube containing multi-spectral optical top of atmosphere reflectances to be corrected.", "name": "data", "schema": { - "subtype": "raster-cube", - "type": "object" + "type": "object", + "subtype": "datacube", + "dimensions": [ + { + "type": "spatial", + "axis": [ + "x", + "y" + ] + }, + { + "type": "bands" + } + ] } }, { @@ -63,8 +75,20 @@ "returns": { "description": "Data cube containing bottom of atmosphere reflectances.", "schema": { - "subtype": "raster-cube", - "type": "object" + "type": "object", + "subtype": "datacube", + "dimensions": [ + { + "type": "spatial", + "axis": [ + "x", + "y" + ] + }, + { + "type": "bands" + } + ] } }, "exceptions": { @@ -79,4 +103,4 @@ "title": "Atmospheric correction explained by EO4GEO body of knowledge." } ] -} \ No newline at end of file +} diff --git a/proposals/cloud_detection.json b/proposals/cloud_detection.json index f9025c5b..d695720e 100644 --- a/proposals/cloud_detection.json +++ b/proposals/cloud_detection.json @@ -12,8 +12,20 @@ "description": "The source data cube containing multi-spectral optical top of the atmosphere (TOA) reflectances on which to perform cloud detection.", "name": "data", "schema": { - "subtype": "raster-cube", - "type": "object" + "type": "object", + "subtype": "datacube", + "dimensions": [ + { + "type": "spatial", + "axis": [ + "x", + "y" + ] + }, + { + "type": "bands" + } + ] } }, { @@ -49,8 +61,20 @@ "returns": { "description": "A data cube with bands for the atmospheric disturbances. Each of the masks contains values between 0 and 1. The data cube has the same spatial and temporal dimensions as the source data cube and a dimension that contains a dimension label for each of the supported/considered atmospheric disturbance.", "schema": { - "subtype": "raster-cube", - "type": "object" + "type": "object", + "subtype": "datacube", + "dimensions": [ + { + "type": "spatial", + "axis": [ + "x", + "y" + ] + }, + { + "type": "bands" + } + ] } }, "links": [ @@ -60,4 +84,4 @@ "title": "Cloud mask explained by EO4GEO body of knowledge." } ] -} \ No newline at end of file +} diff --git a/proposals/filter_labels.json b/proposals/filter_labels.json index 01d77035..cd077306 100644 --- a/proposals/filter_labels.json +++ b/proposals/filter_labels.json @@ -13,7 +13,7 @@ "description": "A data cube.", "schema": { "type": "object", - "subtype": "raster-cube" + "subtype": "datacube" } }, { @@ -74,7 +74,7 @@ "description": "A data cube with the same dimensions. The dimension properties (name, type, labels, reference system and resolution) remain unchanged, except that the given dimension has less (or the same) dimension labels.", "schema": { "type": "object", - "subtype": "raster-cube" + "subtype": "datacube" } }, "exceptions": { @@ -115,4 +115,4 @@ "title": "Filters explained in the openEO documentation" } ] -} \ No newline at end of file +} diff --git a/proposals/fit_class_random_forest.json b/proposals/fit_class_random_forest.json index a9a549d9..11f0c9b9 100644 --- a/proposals/fit_class_random_forest.json +++ b/proposals/fit_class_random_forest.json @@ -12,7 +12,12 @@ "description": "The predictors for the classification model as a vector data cube. Aggregated to the features (vectors) of the target input variable.", "schema": { "type": "object", - "subtype": "vector-cube" + "subtype": "datacube", + "dimensions": [ + { + "type": "vector" + } + ] } }, { @@ -20,7 +25,12 @@ "description": "The training sites for the classification model as a vector data cube. This is associated with the target variable for the Random Forest model. The geometry has to associated with a value to predict (e.g. fractional forest canopy cover).", "schema": { "type": "object", - "subtype": "vector-cube" + "subtype": "datacube", + "dimensions": [ + { + "type": "vector" + } + ] } }, { diff --git a/proposals/fit_curve.json b/proposals/fit_curve.json index 3b5df7e1..9d97dfda 100644 --- a/proposals/fit_curve.json +++ b/proposals/fit_curve.json @@ -13,7 +13,7 @@ "description": "A data cube.", "schema": { "type": "object", - "subtype": "raster-cube" + "subtype": "datacube" } }, { @@ -30,7 +30,7 @@ { "title": "Data Cube with optimal values from a previous result of this process.", "type": "object", - "subtype": "raster-cube" + "subtype": "datacube" } ] }, @@ -80,7 +80,7 @@ "description": "A data cube with the optimal values for the parameters.", "schema": { "type": "object", - "subtype": "raster-cube" + "subtype": "datacube" } }, "exceptions": { @@ -91,4 +91,4 @@ "message": "A dimension with the specified name does not exist." } } -} \ No newline at end of file +} diff --git a/proposals/fit_regr_random_forest.json b/proposals/fit_regr_random_forest.json index e75028b2..f2a97ca7 100644 --- a/proposals/fit_regr_random_forest.json +++ b/proposals/fit_regr_random_forest.json @@ -12,7 +12,12 @@ "description": "The predictors for the regression model as a vector data cube. Aggregated to the features (vectors) of the target input variable.", "schema": { "type": "object", - "subtype": "vector-cube" + "subtype": "datacube", + "dimensions": [ + { + "type": "vector" + } + ] } }, { @@ -20,7 +25,12 @@ "description": "The training sites for the regression model as a vector data cube. This is associated with the target variable for the Random Forest model. The geometry has to associated with a value to predict (e.g. fractional forest canopy cover).", "schema": { "type": "object", - "subtype": "vector-cube" + "subtype": "datacube", + "dimensions": [ + { + "type": "vector" + } + ] } }, { diff --git a/proposals/flatten_dimensions.json b/proposals/flatten_dimensions.json index 05e54212..da3647ab 100644 --- a/proposals/flatten_dimensions.json +++ b/proposals/flatten_dimensions.json @@ -12,7 +12,7 @@ "description": "A data cube.", "schema": { "type": "object", - "subtype": "raster-cube" + "subtype": "datacube" } }, { @@ -47,7 +47,7 @@ "description": "A data cube with the new shape. The dimension properties (name, type, labels, reference system and resolution) for all other dimensions remain unchanged.", "schema": { "type": "object", - "subtype": "raster-cube" + "subtype": "datacube" } }, "exceptions": { diff --git a/proposals/load_result.json b/proposals/load_result.json index fa056b48..46ed4a53 100644 --- a/proposals/load_result.json +++ b/proposals/load_result.json @@ -196,7 +196,7 @@ "description": "A data cube for further processing.", "schema": { "type": "object", - "subtype": "raster-cube" + "subtype": "datacube" } } } diff --git a/proposals/load_uploaded_files.json b/proposals/load_uploaded_files.json index bf811b4e..039994ff 100644 --- a/proposals/load_uploaded_files.json +++ b/proposals/load_uploaded_files.json @@ -44,7 +44,7 @@ "description": "A data cube for further processing.", "schema": { "type": "object", - "subtype": "raster-cube" + "subtype": "datacube" } }, "exceptions": { diff --git a/proposals/predict_curve.json b/proposals/predict_curve.json index 52adcc5e..9fb5d341 100644 --- a/proposals/predict_curve.json +++ b/proposals/predict_curve.json @@ -13,15 +13,15 @@ "description": "A data cube to predict values for.", "schema": { "type": "object", - "subtype": "raster-cube" + "subtype": "datacube" } }, { "name": "parameters", - "description": "A data cube with optimal values from a result of e.g. ``fit_curve()``.", + "description": "A data cube with optimal values, e.g. computed by the process ``fit_curve()``.", "schema": { "type": "object", - "subtype": "raster-cube" + "subtype": "datacube" } }, { @@ -101,7 +101,7 @@ "description": "A data cube with the predicted values.", "schema": { "type": "object", - "subtype": "raster-cube" + "subtype": "datacube" } }, "exceptions": { @@ -109,4 +109,4 @@ "message": "A dimension with the specified name does not exist." } } -} \ No newline at end of file +} diff --git a/proposals/reduce_spatial.json b/proposals/reduce_spatial.json index d9a2fb56..77d64d71 100644 --- a/proposals/reduce_spatial.json +++ b/proposals/reduce_spatial.json @@ -11,10 +11,19 @@ "parameters": [ { "name": "data", - "description": "A data cube.", + "description": "A raster data cube.", "schema": { "type": "object", - "subtype": "raster-cube" + "subtype": "datacube", + "dimensions": [ + { + "type": "spatial", + "axis": [ + "x", + "y" + ] + } + ] } }, { @@ -63,10 +72,10 @@ } ], "returns": { - "description": "A data cube with the newly computed values. It is missing the horizontal spatial dimensions, the number of dimensions decreases by two. The dimension properties (name, type, labels, reference system and resolution) for all other dimensions remain unchanged.", + "description": "A raster data cube with the newly computed values. It is missing the horizontal spatial dimensions, the number of dimensions decreases by two. The dimension properties (name, type, labels, reference system and resolution) for all other dimensions remain unchanged.", "schema": { "type": "object", - "subtype": "raster-cube" + "subtype": "datacube" } }, "links": [ @@ -76,4 +85,4 @@ "title": "Reducers explained in the openEO documentation" } ] -} \ No newline at end of file +} diff --git a/proposals/resample_cube_temporal.json b/proposals/resample_cube_temporal.json index 2bd38dde..5ebb8f47 100644 --- a/proposals/resample_cube_temporal.json +++ b/proposals/resample_cube_temporal.json @@ -13,7 +13,12 @@ "description": "A data cube with one or more temporal dimensions.", "schema": { "type": "object", - "subtype": "raster-cube" + "subtype": "datacube", + "dimensions": [ + { + "type": "temporal" + } + ] } }, { @@ -21,7 +26,12 @@ "description": "A data cube that describes the temporal target resolution.", "schema": { "type": "object", - "subtype": "raster-cube" + "subtype": "datacube", + "dimensions": [ + { + "type": "temporal" + } + ] } }, { @@ -53,7 +63,12 @@ "description": "A raster data cube with the same dimensions and the same dimension properties (name, type, labels, reference system and resolution) for all non-temporal dimensions. For the temporal dimension, the name and type remain unchanged, but the dimension labels, resolution and reference system may change.", "schema": { "type": "object", - "subtype": "raster-cube" + "subtype": "datacube", + "dimensions": [ + { + "type": "temporal" + } + ] } }, "exceptions": { @@ -71,4 +86,4 @@ "title": "Resampling explained in the openEO documentation" } ] -} \ No newline at end of file +} diff --git a/proposals/sar_backscatter.json b/proposals/sar_backscatter.json index 77fdf73e..03d13d29 100644 --- a/proposals/sar_backscatter.json +++ b/proposals/sar_backscatter.json @@ -12,8 +12,20 @@ "name": "data", "description": "The source data cube containing SAR input.", "schema": { - "subtype": "raster-cube", - "type": "object" + "type": "object", + "subtype": "datacube", + "dimensions": [ + { + "type": "spatial", + "axis": [ + "x", + "y" + ] + }, + { + "type": "bands" + } + ] } }, { @@ -112,8 +124,20 @@ "returns": { "description": "Backscatter values corresponding to the chosen parametrization. The values are given in linear scale.", "schema": { - "subtype": "raster-cube", - "type": "object" + "type": "object", + "subtype": "datacube", + "dimensions": [ + { + "type": "spatial", + "axis": [ + "x", + "y" + ] + }, + { + "type": "bands" + } + ] } }, "exceptions": { diff --git a/proposals/unflatten_dimension.json b/proposals/unflatten_dimension.json index 1cbf2d1d..990e7469 100644 --- a/proposals/unflatten_dimension.json +++ b/proposals/unflatten_dimension.json @@ -12,7 +12,7 @@ "description": "A data cube that is consistently structured so that operation can execute flawlessly (e.g. the dimension labels need to contain the `label_separator` exactly 1 time for two target dimensions, 2 times for three target dimensions etc.).", "schema": { "type": "object", - "subtype": "raster-cube" + "subtype": "datacube" } }, { @@ -48,7 +48,7 @@ "description": "A data cube with the new shape. The dimension properties (name, type, labels, reference system and resolution) for all other dimensions remain unchanged.", "schema": { "type": "object", - "subtype": "raster-cube" + "subtype": "datacube" } }, "exceptions": { diff --git a/proposals/vector_buffer.json b/proposals/vector_buffer.json index 204a54b7..9ee12fa6 100644 --- a/proposals/vector_buffer.json +++ b/proposals/vector_buffer.json @@ -17,7 +17,12 @@ }, { "type": "object", - "subtype": "vector-cube" + "subtype": "datacube", + "dimensions": [ + { + "type": "vector" + } + ] } ] }, @@ -36,7 +41,12 @@ "description": "Returns a vector data cube with the computed new geometries.", "schema": { "type": "object", - "subtype": "vector-cube" + "subtype": "datacube", + "dimensions": [ + { + "type": "vector" + } + ] } } } diff --git a/proposals/vector_to_random_points.json b/proposals/vector_to_random_points.json index afe340ef..4aa6a3d9 100644 --- a/proposals/vector_to_random_points.json +++ b/proposals/vector_to_random_points.json @@ -18,7 +18,12 @@ }, { "type": "object", - "subtype": "vector-cube" + "subtype": "datacube", + "dimensions": [ + { + "type": "vector" + } + ] } ] }, @@ -80,7 +85,12 @@ "description": "Returns a vector data cube with the sampled points.", "schema": { "type": "object", - "subtype": "vector-cube" + "subtype": "datacube", + "dimensions": [ + { + "type": "vector" + } + ] } }, "exceptions": { diff --git a/proposals/vector_to_regular_points.json b/proposals/vector_to_regular_points.json index 3fd105f6..ce281485 100644 --- a/proposals/vector_to_regular_points.json +++ b/proposals/vector_to_regular_points.json @@ -18,7 +18,12 @@ }, { "type": "object", - "subtype": "vector-cube" + "subtype": "datacube", + "dimensions": [ + { + "type": "vector" + } + ] } ] }, @@ -44,7 +49,12 @@ "description": "Returns a vector data cube with the sampled points.", "schema": { "type": "object", - "subtype": "vector-cube" + "subtype": "datacube", + "dimensions": [ + { + "type": "vector" + } + ] } } } diff --git a/reduce_dimension.json b/reduce_dimension.json index 27ed34de..83647d00 100644 --- a/reduce_dimension.json +++ b/reduce_dimension.json @@ -12,7 +12,7 @@ "description": "A data cube.", "schema": { "type": "object", - "subtype": "raster-cube" + "subtype": "datacube" } }, { @@ -72,7 +72,7 @@ "description": "A data cube with the newly computed values. It is missing the given dimension, the number of dimensions decreases by one. The dimension properties (name, type, labels, reference system and resolution) for all other dimensions remain unchanged.", "schema": { "type": "object", - "subtype": "raster-cube" + "subtype": "datacube" } }, "exceptions": { @@ -87,4 +87,4 @@ "title": "Reducers explained in the openEO documentation" } ] -} \ No newline at end of file +} diff --git a/rename_dimension.json b/rename_dimension.json index 15c46410..ecfd1983 100644 --- a/rename_dimension.json +++ b/rename_dimension.json @@ -11,7 +11,7 @@ "description": "The data cube.", "schema": { "type": "object", - "subtype": "raster-cube" + "subtype": "datacube" } }, { @@ -33,7 +33,7 @@ "description": "A data cube with the same dimensions, but the name of one of the dimensions changes. The old name can not be referred to any longer. The dimension properties (name, type, labels, reference system and resolution) remain unchanged.", "schema": { "type": "object", - "subtype": "raster-cube" + "subtype": "datacube" } }, "exceptions": { @@ -44,4 +44,4 @@ "message": "A dimension with the specified name already exists." } } -} \ No newline at end of file +} diff --git a/rename_labels.json b/rename_labels.json index 41fe7d7d..2042737d 100644 --- a/rename_labels.json +++ b/rename_labels.json @@ -11,7 +11,7 @@ "description": "The data cube.", "schema": { "type": "object", - "subtype": "raster-cube" + "subtype": "datacube" } }, { @@ -54,7 +54,7 @@ "description": "The data cube with the same dimensions. The dimension properties (name, type, labels, reference system and resolution) remain unchanged, except that for the given dimension the labels change. The old labels can not be referred to any longer. The number of labels remains the same.", "schema": { "type": "object", - "subtype": "raster-cube" + "subtype": "datacube" } }, "exceptions": { diff --git a/resample_cube_spatial.json b/resample_cube_spatial.json index 54a5f801..3cbdfa49 100644 --- a/resample_cube_spatial.json +++ b/resample_cube_spatial.json @@ -9,18 +9,36 @@ "parameters": [ { "name": "data", - "description": "A data cube.", + "description": "A raster data cube.", "schema": { "type": "object", - "subtype": "raster-cube" + "subtype": "datacube", + "dimensions": [ + { + "type": "spatial", + "axis": [ + "x", + "y" + ] + } + ] } }, { "name": "target", - "description": "A data cube that describes the spatial target resolution.", + "description": "A raster data cube that describes the spatial target resolution.", "schema": { "type": "object", - "subtype": "raster-cube" + "subtype": "datacube", + "dimensions": [ + { + "type": "spatial", + "axis": [ + "x", + "y" + ] + } + ] } }, { @@ -50,10 +68,19 @@ } ], "returns": { - "description": "A data cube with the same dimensions. The dimension properties (name, type, labels, reference system and resolution) remain unchanged, except for the resolution and dimension labels of the spatial dimensions.", + "description": "A raster data cube with the same dimensions. The dimension properties (name, type, labels, reference system and resolution) remain unchanged, except for the resolution and dimension labels of the spatial dimensions.", "schema": { "type": "object", - "subtype": "raster-cube" + "subtype": "datacube", + "dimensions": [ + { + "type": "spatial", + "axis": [ + "x", + "y" + ] + } + ] } }, "links": [ diff --git a/resample_spatial.json b/resample_spatial.json index 91d6bc5f..d97865f2 100644 --- a/resample_spatial.json +++ b/resample_spatial.json @@ -12,7 +12,16 @@ "description": "A raster data cube.", "schema": { "type": "object", - "subtype": "raster-cube" + "subtype": "datacube", + "dimensions": [ + { + "type": "spatial", + "axis": [ + "x", + "y" + ] + } + ] } }, { @@ -115,7 +124,16 @@ "description": "A raster data cube with values warped onto the new projection. It has the same dimensions and the same dimension properties (name, type, labels, reference system and resolution) for all non-spatial or vertical spatial dimensions. For the horizontal spatial dimensions the name and type remain unchanged, but reference system, labels and resolution may change depending on the given parameters.", "schema": { "type": "object", - "subtype": "raster-cube" + "subtype": "datacube", + "dimensions": [ + { + "type": "spatial", + "axis": [ + "x", + "y" + ] + } + ] } }, "links": [ @@ -145,4 +163,4 @@ "title": "gdalwarp resampling methods" } ] -} \ No newline at end of file +} diff --git a/save_result.json b/save_result.json index 0ad0a582..8fa67ebb 100644 --- a/save_result.json +++ b/save_result.json @@ -10,16 +10,10 @@ { "name": "data", "description": "The data to deliver in the given file format.", - "schema": [ - { - "type": "object", - "subtype": "raster-cube" - }, - { - "type": "object", - "subtype": "vector-cube" - } - ] + "schema": { + "type": "object", + "subtype": "datacube" + } }, { "name": "format", diff --git a/tests/package.json b/tests/package.json index be51806f..861bfe5f 100644 --- a/tests/package.json +++ b/tests/package.json @@ -1,6 +1,6 @@ { "name": "@openeo/processes-validator", - "version": "0.2.0", + "version": "0.3.0", "author": "openEO Consortium", "contributors": [ { diff --git a/tests/testHelpers.js b/tests/testHelpers.js index 418fd830..376f0763 100644 --- a/tests/testHelpers.js +++ b/tests/testHelpers.js @@ -106,7 +106,57 @@ async function getAjv() { }, compile: function (subtype, schema) { if (schema.type != subtypes.definitions[subtype].type) { - throw "Subtype '"+subtype+"' not allowed for type '"+schema.type+"'." + throw "Subtype '"+subtype+"' not allowed for type '"+schema.type+"'."; + } + if (subtypes.definitions[subtype].deprecated) { + throw "Deprecated subtypes not allowed."; + } + return () => true; + }, + errors: false + }); + jsv.addKeyword("dimensions", { + dependencies: [ + "type", + "subtype" + ], + metaSchema: { + type: "array", + minItems: 1, + items: { + type: "object", + required: ["type"], + oneOf: [ + { + properties: { + type: { + type: "string", + const: "spatial" + }, + axis: { + type: "array", + minItems: 1, + items: { + type: "string", + enum: ["x", "y", "z"] + } + } + } + }, + { + properties: { + type: { + type: "string", + enum: ["bands", "temporal", "vector", "other"] + } + } + } + ] + } + }, + compile: function (_, schema) { + if (schema.subtype != 'datacube') { + throw "Dimensions only allowed for subtype 'datacube'." } return () => true; }, diff --git a/trim_cube.json b/trim_cube.json index 4329024e..c3c7891e 100644 --- a/trim_cube.json +++ b/trim_cube.json @@ -8,18 +8,18 @@ "parameters": [ { "name": "data", - "description": "A raster data cube to trim.", + "description": "A data cube to trim.", "schema": { "type": "object", - "subtype": "raster-cube" + "subtype": "datacube" } } ], "returns": { - "description": "A trimmed raster data cube with the same dimensions. The dimension properties name, type, reference system and resolution remain unchanged. The number of dimension labels may decrease.", + "description": "A trimmed data cube with the same dimensions. The dimension properties name, type, reference system and resolution remain unchanged. The number of dimension labels may decrease.", "schema": { "type": "object", - "subtype": "raster-cube" + "subtype": "datacube" } } -} \ No newline at end of file +}