Skip to content

Commit

Permalink
Streamline geojson import #346
Browse files Browse the repository at this point in the history
  • Loading branch information
m-mohr committed Mar 10, 2023
1 parent db242a8 commit 4d69d6e
Show file tree
Hide file tree
Showing 13 changed files with 142 additions and 90 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- `fit_class_random_forest`
- `fit_regr_random_forest`
- `flatten_dimensions`
- `load_geojson`
- `load_ml_model`
- `predict_random_forest`
- `save_ml_model`
Expand Down Expand Up @@ -47,12 +48,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Renamed `create_raster_cube` to `create_data_cube`. [#68](https://github.com/Open-EO/openeo-processes/issues/68)
- Updated the processes based on the subtypes `raster-cube` or `vector-cube` to work with the subtype `datacube` instead. [#68](https://github.com/Open-EO/openeo-processes/issues/68)

### Deprecated

- `aggregate_spatial`, `filter_spatial`, `load_collection`, `mask_polygon`: GeoJSON input is deprecated. Use `load_geojson` instead. [#346](https://github.com/Open-EO/openeo-processes/issues/346)

### Removed

- The `examples` folder has been migrated to the [openEO Community Examples](https://github.com/Open-EO/openeo-community-examples/tree/main/processes) repository.
- `between`: Support for temporal comparison.
- Deprecated `GeometryCollections` are not supported any longer. [#389](https://github.com/Open-EO/openeo-processes/issues/389)
- Deprecated PROJ definitions for the CRS are not supported any longer.
- `load_result`: GeoJSON input is not supported any longer. Use `load_geojson` instead. [#346](https://github.com/Open-EO/openeo-processes/issues/346)

### Fixed

Expand Down
13 changes: 8 additions & 5 deletions aggregate_spatial.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,21 @@
"description": "Geometries for which the aggregation will be computed. Feature properties are preserved for vector data cubes and all GeoJSON Features.\n\nOne value will be computed per label in the dimension of type `geometries`, GeoJSON `Feature` or `Geometry`. For a `FeatureCollection` multiple values will be computed, one value per contained `Feature`. For example, a single value will be computed for a `MultiPolygon`, but two values will be computed for a `FeatureCollection` containing two polygons.\n\n- For **polygons**, the process considers all pixels for which the point at the pixel center intersects with the corresponding polygon (as defined in the Simple Features standard by the OGC).\n- For **points**, the process considers the closest pixel center.\n- For **lines** (line strings), the process considers all the pixels whose centers are closest to at least one point on the line.\n\nThus, pixels may be part of multiple geometries and be part of multiple aggregations. No operation is applied to geometries that are outside of the bounds of the data.",
"schema": [
{
"type": "object",
"subtype": "geojson",
"description": "The GeoJSON type `GeometryCollection` is not supported."
},
{
"title": "Vector Data Cube",
"type": "object",
"subtype": "datacube",
"dimensions": [
{
"type": "geometries"
}
]
},
{
"title": "GeoJSON (deprecated)",
"type": "object",
"subtype": "geojson",
"description": "The GeoJSON type `GeometryCollection` is not supported.",
"deprecated": true
}
]
},
Expand Down
12 changes: 8 additions & 4 deletions filter_spatial.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,21 @@
"description": "One or more geometries used for filtering, given as GeoJSON or vector data cube. If multiple geometries are provided, the union of them is used.\n\nLimits the data cube to the bounding box of the given geometries. No implicit masking gets applied. To mask the pixels of the data cube use ``mask_polygon()``.",
"schema": [
{
"type": "object",
"subtype": "geojson"
},
{
"title": "Vector Data Cube",
"type": "object",
"subtype": "datacube",
"dimensions": [
{
"type": "geometries"
}
]
},
{
"title": "GeoJSON (deprecated)",
"type": "object",
"subtype": "geojson",
"description": "The GeoJSON type `GeometryCollection` is not supported.",
"deprecated": true
}
]
}
Expand Down
5 changes: 3 additions & 2 deletions load_collection.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,11 @@
}
},
{
"title": "GeoJSON",
"title": "GeoJSON (deprecated)",
"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.",
"type": "object",
"subtype": "geojson"
"subtype": "geojson",
"deprecated": true
},
{
"title": "Vector data cube",
Expand Down
13 changes: 8 additions & 5 deletions mask_polygon.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,7 @@
"description": "A GeoJSON object or a vector data cube containing at least one polygon. The provided vector data can be one of the following:\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.",
"schema": [
{
"type": "object",
"subtype": "geojson",
"description": "The GeoJSON type `GeometryCollection` is not supported."
},
{
"title": "Vector Data Cube",
"type": "object",
"subtype": "datacube",
"dimensions": [
Expand All @@ -45,6 +41,13 @@
]
}
]
},
{
"title": "GeoJSON (deprecated)",
"type": "object",
"subtype": "geojson",
"description": "The GeoJSON type `GeometryCollection` is not supported.",
"deprecated": true
}
]
},
Expand Down
27 changes: 10 additions & 17 deletions proposals/filter_vector.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,16 @@
},
{
"name": "geometries",
"description": "One or more base geometries used for filtering, given as GeoJSON or vector data cube. If multiple base geometries are provided, the union of them is used.",
"schema": [
{
"type": "object",
"subtype": "geojson",
"description": "The GeoJSON type `GeometryCollection` is not supported."
},
{
"type": "object",
"subtype": "datacube",
"dimensions": [
{
"type": "geometries"
}
]
}
]
"description": "One or more base geometries used for filtering, given as vector data cube. If multiple base geometries are provided, the union of them is used.",
"schema": {
"type": "object",
"subtype": "datacube",
"dimensions": [
{
"type": "geometries"
}
]
}
},
{
"name": "relation",
Expand Down
68 changes: 68 additions & 0 deletions proposals/load_geojson.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
{
"id": "load_geojson",
"summary": "Load GeoJSON data",
"description": "Loads 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": "The GeoJSON data. Can either be inline GeoJSON, a user-uploaded file, or point to a remote URL. The GeoJSON type `GeometryCollection` is not supported. Each geometry in the GeoJSON data results in a dimension label in the `geometries` dimension.",
"schema": [
{
"title": "GeoJSON",
"description": "GeoJSON (inline)",
"type": "object",
"subtype": "geojson"
},
{
"title": "URL",
"type": "string",
"format": "uri",
"subtype": "uri",
"pattern": "^https?://"
},
{
"title": "User-uploaded file",
"type": "string",
"subtype": "file-path",
"pattern": "^[^\r\n\\:'\"]+$"
}
]
},
{
"name": "properties",
"description": "One or more properties from the GeoJSON file to construct a additional dimension from. Only applies for GeoJSON Features and FeatureCollections. Missing values in are generally set to no-data (`null`).\n\nDepending on the number of properties provided the process constructs and names 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.\n\nDepending on the number of properties the dimension name is:\n\n- Single property: Name of the property\n- Multiple properties: `properties`.",
"schema": {
"type": "array",
"uniqueItems": true,
"items": {
"type": "string"
}
}
}
],
"returns": {
"description": "A vector data cube containing the geometries, either one or two dimensional.",
"schema": {
"type": "object",
"subtype": "datacube",
"dimensions": [
{
"type": "geometries"
}
]
}
},
"links": [
{
"href": "https://www.rfc-editor.org/rfc/rfc7946.html",
"title": "RFC 7946: The GeoJSON Format",
"type": "text/html",
"rel": "about"
}
]
}
2 changes: 1 addition & 1 deletion proposals/load_ml_model.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"pattern": "^[\\w\\-\\.~]+$"
},
{
"title": "User-uploaded File",
"title": "User-uploaded file",
"type": "string",
"subtype": "file-path",
"pattern": "^[^\r\n\\:'\"]+$"
Expand Down
8 changes: 1 addition & 7 deletions proposals/load_result.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
},
{
"name": "spatial_extent",
"description": "Limits the data to load from the batch job result 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 of the geometry is fully within 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, 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.",
"description": "Limits the data to load from the batch job result 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 of the geometry is fully within the bounding box or any of the polygons (as defined in the Simple Features standard by the OGC).\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",
Expand Down Expand Up @@ -96,12 +96,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.",
"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`).",
Expand Down
27 changes: 10 additions & 17 deletions proposals/vector_buffer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,16 @@
"parameters": [
{
"name": "geometries",
"description": "Geometries to apply the buffer on. Feature properties are preserved for vector data cubes and all GeoJSON Features.",
"schema": [
{
"type": "object",
"subtype": "geojson",
"description": "The GeoJSON type `GeometryCollection` is not supported."
},
{
"type": "object",
"subtype": "datacube",
"dimensions": [
{
"type": "geometries"
}
]
}
]
"description": "Geometries to apply the buffer on. Feature properties are preserved.",
"schema": {
"type": "object",
"subtype": "datacube",
"dimensions": [
{
"type": "geometries"
}
]
}
},
{
"name": "distance",
Expand Down
25 changes: 9 additions & 16 deletions proposals/vector_to_random_points.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,15 @@
{
"name": "data",
"description": "Input geometries for sample extraction.",
"schema": [
{
"type": "object",
"subtype": "geojson",
"description": "The GeoJSON type `GeometryCollection` is not supported."
},
{
"type": "object",
"subtype": "datacube",
"dimensions": [
{
"type": "geometries"
}
]
}
]
"schema": {
"type": "object",
"subtype": "datacube",
"dimensions": [
{
"type": "geometries"
}
]
}
},
{
"name": "geometry_count",
Expand Down
25 changes: 9 additions & 16 deletions proposals/vector_to_regular_points.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,15 @@
{
"name": "data",
"description": "Input geometries for sample extraction.",
"schema": [
{
"type": "object",
"subtype": "geojson",
"description": "The GeoJSON type `GeometryCollection` is not supported."
},
{
"type": "object",
"subtype": "datacube",
"dimensions": [
{
"type": "geometries"
}
]
}
]
"schema": {
"type": "object",
"subtype": "datacube",
"dimensions": [
{
"type": "geometries"
}
]
}
},
{
"name": "distance",
Expand Down
1 change: 1 addition & 0 deletions tests/.words
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ DEM-based
Domini
gamma0
GeoJSON
FeatureCollections
labeled
MathWorld
n-ary
Expand Down

0 comments on commit 4d69d6e

Please sign in to comment.