From 8d63d0a4eca9968cfa082ad9f38582e182d8ec13 Mon Sep 17 00:00:00 2001 From: Matthias Mohr Date: Mon, 3 Apr 2023 13:11:46 +0200 Subject: [PATCH] Add load_geojson (#427) * Add load_geojson #346 #415 --- CHANGELOG.md | 5 ++-- aggregate_spatial.json | 2 +- filter_spatial.json | 2 +- load_collection.json | 2 +- mask_polygon.json | 2 +- meta/subtype-schemas.json | 2 +- proposals/load_geojson.json | 53 +++++++++++++++++++++++++++++++++++++ tests/.words | 1 + 8 files changed, 62 insertions(+), 7 deletions(-) create mode 100644 proposals/load_geojson.json diff --git a/CHANGELOG.md b/CHANGELOG.md index 69dbd96b..7d268dd9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - `date_difference` - `filter_vector` - `flatten_dimensions` + - `load_geojson` - `load_url` - `unflatten_dimension` - `vector_buffer` @@ -55,7 +56,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Deprecated -- `aggregate_spatial`, `filter_spatial`, `load_collection`, `mask_polygon`: GeoJSON input is deprecated. [#346](https://github.com/Open-EO/openeo-processes/issues/346) +- `aggregate_spatial`, `filter_spatial`, `load_collection`, `mask_polygon`: GeoJSON input is deprecated in favor of `load_geojson`. [#346](https://github.com/Open-EO/openeo-processes/issues/346) ### Removed @@ -66,7 +67,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - `load_result`: - Renamed to `load_stac` - The subtype `job-id` was removed in favor of providing a URL. [#322](https://github.com/Open-EO/openeo-processes/issues/322), [#377](https://github.com/Open-EO/openeo-processes/issues/377), [#384](https://github.com/Open-EO/openeo-processes/issues/384) - - GeoJSON input is not supported any longer. [#346](https://github.com/Open-EO/openeo-processes/issues/346) + - GeoJSON input is not supported any longer. Use `load_geojson` instead. [#346](https://github.com/Open-EO/openeo-processes/issues/346) - The comparison processes `eq`, `neq`, `lt`, `lte`, `gt`, `gte` and `array_contains`: - Removed support for temporal comparison. Instead explicitly use `date_difference`. - Removed support for the input data types array and object. [#208](https://github.com/Open-EO/openeo-processes/issues/208) diff --git a/aggregate_spatial.json b/aggregate_spatial.json index eb913949..06e07918 100644 --- a/aggregate_spatial.json +++ b/aggregate_spatial.json @@ -42,7 +42,7 @@ "title": "GeoJSON", "type": "object", "subtype": "geojson", - "description": "Deprecated. The GeoJSON type `GeometryCollection` is not supported.", + "description": "Deprecated in favor of ``load_geojson()``. The GeoJSON type `GeometryCollection` is not supported.", "deprecated": true } ] diff --git a/filter_spatial.json b/filter_spatial.json index 8f8120ce..c0c116cd 100644 --- a/filter_spatial.json +++ b/filter_spatial.json @@ -42,7 +42,7 @@ "title": "GeoJSON", "type": "object", "subtype": "geojson", - "description": "Deprecated. The GeoJSON type `GeometryCollection` is not supported.", + "description": "Deprecated in favor of ``load_geojson()``. The GeoJSON type `GeometryCollection` is not supported.", "deprecated": true } ] diff --git a/load_collection.json b/load_collection.json index 06d4ac94..49df9650 100644 --- a/load_collection.json +++ b/load_collection.json @@ -87,7 +87,7 @@ }, { "title": "GeoJSON", - "description": "Deprecated. 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.", + "description": "Deprecated in favor of ``load_geojson()``. 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", "deprecated": true diff --git a/mask_polygon.json b/mask_polygon.json index 8d8e3cad..f04d3750 100644 --- a/mask_polygon.json +++ b/mask_polygon.json @@ -46,7 +46,7 @@ "title": "GeoJSON", "type": "object", "subtype": "geojson", - "description": "Deprecated. The GeoJSON type `GeometryCollection` is not supported.", + "description": "Deprecated in favor of ``load_geojson()``. The GeoJSON type `GeometryCollection` is not supported.", "deprecated": true } ] diff --git a/meta/subtype-schemas.json b/meta/subtype-schemas.json index dc527e08..b44cb8dc 100644 --- a/meta/subtype-schemas.json +++ b/meta/subtype-schemas.json @@ -166,7 +166,7 @@ "type": "object", "subtype": "geojson", "title": "GeoJSON", - "description": "Deprecated. GeoJSON as defined by [RFC 7946](https://www.rfc-editor.org/rfc/rfc7946.html). The GeoJSON type `GeometryCollection` is not supported.", + "description": "GeoJSON as defined by [RFC 7946](https://www.rfc-editor.org/rfc/rfc7946.html). The GeoJSON type `GeometryCollection` is not supported.", "deprecated": true, "allOf": [ { diff --git a/proposals/load_geojson.json b/proposals/load_geojson.json new file mode 100644 index 00000000..70566a56 --- /dev/null +++ b/proposals/load_geojson.json @@ -0,0 +1,53 @@ +{ + "id": "load_geojson", + "summary": "Converts GeoJSON into a vector data cube", + "description": "Converts GeoJSON data as defined by [RFC 7946](https://www.rfc-editor.org/rfc/rfc7946.html) into a vector data cube. Feature properties are preserved.", + "categories": [ + "import", + "vector" + ], + "experimental": true, + "parameters": [ + { + "name": "data", + "description": "A GeoJSON object to convert into a vector data cube. The GeoJSON type `GeometryCollection` is not supported. Each geometry in the GeoJSON data results in a dimension label in the `geometries` dimension.", + "schema": { + "type": "object", + "subtype": "geojson" + } + }, + { + "name": "properties", + "description": "A list of properties from the GeoJSON file to construct an additional dimension from. A new dimension with the name `properties` and type `other` is created if at least one property is provided. Only applies for GeoJSON Features and FeatureCollections. Missing values are generally set to no-data (`null`).\n\nDepending on the number of properties provided, the process creates the dimension differently:\n\n- Single property with scalar values: A single dimension label with the name of the property and a single value per geometry.\n- Single property of type array: The dimension labels correspond to the array indices. There are as many values and labels per geometry as there are for the largest array.\n- Multiple properties with scalar values: The dimension labels correspond to the property names. There are as many values and labels per geometry as there are properties provided here.", + "schema": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string" + } + }, + "default": [], + "optional": true + } + ], + "returns": { + "description": "A vector data cube containing the geometries, either one or two dimensional.", + "schema": { + "type": "object", + "subtype": "datacube", + "dimensions": [ + { + "type": "geometry" + } + ] + } + }, + "links": [ + { + "href": "https://www.rfc-editor.org/rfc/rfc7946.html", + "title": "RFC 7946: The GeoJSON Format", + "type": "text/html", + "rel": "about" + } + ] +} diff --git a/tests/.words b/tests/.words index c7f2a702..a50285ba 100644 --- a/tests/.words +++ b/tests/.words @@ -46,3 +46,4 @@ Breiman Hyndman date1 date2 +favor