From e07c3a7fd62cc683ba0214a1518ccc230cf6f4d9 Mon Sep 17 00:00:00 2001 From: clausmichele Date: Wed, 12 Jul 2023 11:26:10 +0200 Subject: [PATCH 1/2] adding load_stac --- load_stac.json | 334 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 334 insertions(+) create mode 100644 load_stac.json diff --git a/load_stac.json b/load_stac.json new file mode 100644 index 00000000..c71d3a80 --- /dev/null +++ b/load_stac.json @@ -0,0 +1,334 @@ +{ + "id": "load_stac", + "summary": "Loads data from STAC", + "description": "Loads data from a static STAC catalog or a STAC API Collection and returns the data as a processable data cube. A batch job result can be loaded by providing a reference to it.\n\nIf supported by the underlying metadata and file format, the data that is added to the data cube can be restricted with the parameters `spatial_extent`, `temporal_extent` and `bands`. 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 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" + ], + "experimental": true, + "parameters": [ + { + "name": "url", + "description": "The URL to a static STAC catalog (STAC Item, STAC Collection, or STAC Catalog) or a specific STAC API Collection that allows to filter items and to download assets. This includes batch job results, which itself are compliant to STAC. For external URLs, authentication details such as API keys or tokens may need to be included in the URL.\n\nBatch job results can be specified in two ways:\n\n- For Batch job results at the same back-end, a URL pointing to the corresponding batch job results endpoint should be provided. The URL usually ends with `/jobs/{id}/results` and `{id}` is the corresponding batch job ID.\n- For external results, a signed URL must be provided. Not all back-ends support signed URLs, which are provided as a link with the link relation `canonical` in the batch job result metadata.", + "schema": { + "title": "URL", + "type": "string", + "format": "uri", + "subtype": "uri", + "pattern": "^https?://" + } + }, + { + "name": "spatial_extent", + "description": "Limits the data to load to the specified bounding box or polygons.\n\n* For raster data, the process loads the 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* For vector data, the process loads the geometry into the data cube if the geometry is fully within the bounding box or any of the polygons (as defined in the Simple Features standard by the OGC). Empty geometries may only be in the data cube if no spatial extent has been provided.\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, or\n* a `FeatureCollection` containing at least one `Feature` with `Polygon` or `MultiPolygon` geometries.\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", + "type": "object", + "subtype": "bounding-box", + "required": [ + "west", + "south", + "east", + "north" + ], + "properties": { + "west": { + "description": "West (lower left corner, coordinate axis 1).", + "type": "number" + }, + "south": { + "description": "South (lower left corner, coordinate axis 2).", + "type": "number" + }, + "east": { + "description": "East (upper right corner, coordinate axis 1).", + "type": "number" + }, + "north": { + "description": "North (upper right corner, coordinate axis 2).", + "type": "number" + }, + "base": { + "description": "Base (optional, lower left corner, coordinate axis 3).", + "type": [ + "number", + "null" + ], + "default": null + }, + "height": { + "description": "Height (optional, upper right corner, coordinate axis 3).", + "type": [ + "number", + "null" + ], + "default": null + }, + "crs": { + "description": "Coordinate reference system of the extent, specified as as [EPSG code](http://www.epsg-registry.org/) or [WKT2 CRS string](http://docs.opengeospatial.org/is/18-010r7/18-010r7.html). Defaults to `4326` (EPSG code 4326) unless the client explicitly requests a different coordinate reference system.", + "anyOf": [ + { + "title": "EPSG Code", + "type": "integer", + "subtype": "epsg-code", + "minimum": 1000, + "examples": [ + 3857 + ] + }, + { + "title": "WKT2", + "type": "string", + "subtype": "wkt2-definition" + } + ], + "default": 4326 + } + } + }, + { + "title": "GeoJSON", + "description": "Limits the data cube to the bounding box of the given geometries. For raster data, all pixels inside the bounding box that do not intersect with any of the polygons will be set to no data (`null`).\n\nThe GeoJSON type `GeometryCollection` is not supported. Empty geometries are ignored.", + "type": "object", + "subtype": "geojson" + }, + { + "title": "Vector data cube", + "description": "Limits the data cube to the bounding box of the given geometries in the vector data cube. All pixels inside the bounding box that do not intersect with any of the polygons will be set to no data (`null`). Empty geometries are ignored.", + "type": "object", + "subtype": "datacube", + "dimensions": [ + { + "type": "geometry" + } + ] + }, + { + "title": "No filter", + "description": "Don't filter spatially. All data is included in the data cube.", + "type": "null" + } + ], + "default": null, + "optional": true + }, + { + "name": "temporal_extent", + "description": "Limits the data to load to the specified left-closed temporal interval. Applies to all temporal dimensions. The interval has to be specified as an array with exactly two elements:\n\n1. The first element is the start of the temporal interval. The specified instance in time is **included** in the interval.\n2. The second element is the end of the temporal interval. The specified instance in time is **excluded** from the interval.\n\nThe second element must always be greater/later than the first element. Otherwise, a `TemporalExtentEmpty` exception is thrown.\n\nAlso supports open intervals by setting one of the boundaries to `null`, but never both.\n\nSet this parameter to `null` to set no limit for the temporal extent. Be careful with this when loading large datasets! It is recommended to use this parameter instead of using ``filter_temporal()`` directly after loading unbounded data.", + "schema": [ + { + "type": "array", + "subtype": "temporal-interval", + "uniqueItems": true, + "minItems": 2, + "maxItems": 2, + "items": { + "anyOf": [ + { + "type": "string", + "format": "date-time", + "subtype": "date-time", + "description": "Date and time with a time zone." + }, + { + "type": "string", + "format": "date", + "subtype": "date", + "description": "Date only, formatted as `YYYY-MM-DD`. The time zone is UTC. Missing time components are all 0." + }, + { + "type": "null" + } + ] + }, + "examples": [ + [ + "2015-01-01T00:00:00Z", + "2016-01-01T00:00:00Z" + ], + [ + "2015-01-01", + "2016-01-01" + ] + ] + }, + { + "title": "No filter", + "description": "Don't filter temporally. All data is included in the data cube.", + "type": "null" + } + ], + "default": null, + "optional": true + }, + { + "name": "bands", + "description": "Only adds the specified bands into the data cube so that bands that don't match the list of band names are not available. Applies to all dimensions of type `bands`.\n\nEither the unique band name (metadata field `name` in bands) or one of the common band names (metadata field `common_name` in bands) can be specified. If the unique band name and the common name conflict, the unique band name has a higher priority.\n\nThe order of the specified array defines the order of the bands in the data cube. If multiple bands match a common name, all matched bands are included in the original order.\n\nIt is recommended to use this parameter instead of using ``filter_bands()`` directly after loading unbounded data.", + "schema": [ + { + "type": "array", + "minItems": 1, + "items": { + "type": "string", + "subtype": "band-name" + } + }, + { + "title": "No filter", + "description": "Don't filter bands. All bands are included in the data cube.", + "type": "null" + } + ], + "default": null, + "optional": true + }, + { + "name": "properties", + "description": "Limits the data by metadata properties to include only data in the data cube which all given conditions return `true` for (AND operation).\n\nSpecify key-value-pairs with the key being the name of the metadata property, which can be retrieved with the openEO Data Discovery for Collections. The value must be a condition (user-defined process) to be evaluated against a STAC API. This parameter is not supported for static STAC.", + "schema": [ + { + "type": "object", + "subtype": "metadata-filter", + "title": "Filters", + "description": "A list of filters to check against. Specify key-value-pairs with the key being the name of the metadata property name and the value being a process evaluated against the metadata values.", + "additionalProperties": { + "type": "object", + "subtype": "process-graph", + "parameters": [ + { + "name": "value", + "description": "The property value to be checked against.", + "schema": { + "description": "Any data type." + } + } + ], + "returns": { + "description": "`true` if the data should be loaded into the data cube, otherwise `false`.", + "schema": { + "type": "boolean" + } + } + } + }, + { + "title": "No filter", + "description": "Don't filter by metadata properties.", + "type": "null" + } + ], + "default": null, + "optional": true + } + ], + "returns": { + "description": "A data cube for further processing.", + "schema": { + "type": "object", + "subtype": "datacube" + } + }, + "examples": [ + { + "title": "Load from a static STAC / batch job result", + "arguments": { + "url": "https://example.com/api/v1.0/jobs/123/results" + } + }, + { + "title": "Load from a STAC API", + "arguments": { + "url": "https://example.com/collections/SENTINEL2", + "spatial_extent": { + "west": 16.1, + "east": 16.6, + "north": 48.6, + "south": 47.2 + }, + "temporal_extent": [ + "2018-01-01", + "2019-01-01" + ], + "properties": { + "eo:cloud_cover": { + "process_graph": { + "cc": { + "process_id": "between", + "arguments": { + "x": { + "from_parameter": "value" + }, + "min": 0, + "max": 50 + }, + "result": true + } + } + }, + "platform": { + "process_graph": { + "pf": { + "process_id": "eq", + "arguments": { + "x": { + "from_parameter": "value" + }, + "y": "Sentinel-2B", + "case_sensitive": false + }, + "result": true + } + } + } + } + } + } + ], + "exceptions": { + "NoDataAvailable": { + "message": "There is no data available for the given extents." + }, + "TemporalExtentEmpty": { + "message": "The temporal extent is empty. The second instant in time must always be greater/later than the first instant in time." + } + }, + "links": [ + { + "href": "https://openeo.org/documentation/1.0/datacubes.html", + "rel": "about", + "title": "Data Cubes explained in the openEO documentation" + }, + { + "rel": "about", + "href": "https://proj.org/usage/projections.html", + "title": "PROJ parameters for cartographic projections" + }, + { + "rel": "about", + "href": "http://www.epsg-registry.org", + "title": "Official EPSG code registry" + }, + { + "rel": "about", + "href": "http://www.epsg.io", + "title": "Unofficial EPSG code database" + }, + { + "href": "http://www.opengeospatial.org/standards/sfa", + "rel": "about", + "title": "Simple Features standard by the OGC" + }, + { + "rel": "about", + "href": "https://github.com/radiantearth/stac-spec/tree/master/extensions/eo#common-band-names", + "title": "List of common band names as specified by the STAC specification" + }, + { + "href": "https://www.rfc-editor.org/rfc/rfc3339.html", + "rel": "about", + "title": "RFC3339: Details about formatting temporal strings" + } + ] +} From 6386ae0215204cfd281deaccbc9c5fee19efba43 Mon Sep 17 00:00:00 2001 From: clausmichele Date: Wed, 12 Jul 2023 14:15:56 +0200 Subject: [PATCH 2/2] Remove geojson, not implemented yet --- load_stac.json | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/load_stac.json b/load_stac.json index c71d3a80..9ac7d4bd 100644 --- a/load_stac.json +++ b/load_stac.json @@ -88,23 +88,6 @@ } } }, - { - "title": "GeoJSON", - "description": "Limits the data cube to the bounding box of the given geometries. For raster data, all pixels inside the bounding box that do not intersect with any of the polygons will be set to no data (`null`).\n\nThe GeoJSON type `GeometryCollection` is not supported. Empty geometries are ignored.", - "type": "object", - "subtype": "geojson" - }, - { - "title": "Vector data cube", - "description": "Limits the data cube to the bounding box of the given geometries in the vector data cube. All pixels inside the bounding box that do not intersect with any of the polygons will be set to no data (`null`). Empty geometries are ignored.", - "type": "object", - "subtype": "datacube", - "dimensions": [ - { - "type": "geometry" - } - ] - }, { "title": "No filter", "description": "Don't filter spatially. All data is included in the data cube.",