From 6ca3d70040319943e7006f7cae8df7e31abdb974 Mon Sep 17 00:00:00 2001 From: Matthias Mohr Date: Mon, 20 Dec 2021 15:53:20 +0100 Subject: [PATCH] Add raster_to_points #313 --- CHANGELOG.md | 5 ++ proposals/raster_to_points.json | 81 +++++++++++++++++++++++++++++++++ 2 files changed, 86 insertions(+) create mode 100644 proposals/raster_to_points.json diff --git a/CHANGELOG.md b/CHANGELOG.md index ef5fd7f3..75f6895a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased / Draft +### Added + +- New processes in proposal state: + - `raster_to_points` + ## [1.2.0] - 2021-12-13 ### Added diff --git a/proposals/raster_to_points.json b/proposals/raster_to_points.json new file mode 100644 index 00000000..bf311e53 --- /dev/null +++ b/proposals/raster_to_points.json @@ -0,0 +1,81 @@ +{ + "id": "raster_to_points", + "summary": "Sample random points from rasters", + "description": "The given raster data cubes is converted into a set of point samples per geometry given. The samples are always taken at the pixel center.", + "categories": [ + "cubes", + "vector" + ], + "experimental": true, + "parameters": [ + { + "name": "data", + "description": "The raster data cube to extract a sample from.", + "schema": { + "type": "object", + "subtype": "raster-cube" + } + }, + { + "name": "geometries", + "description": "Geometries to extract samples for. If not given or `null`, the bounding box of the raster data cube is used as the Polygon to sample for.\n\nTo maximize interoperability, a nested `GeometryCollection` should be avoided. Furthermore, a `GeometryCollection` composed of a single type of geometries should be avoided in favour of the corresponding multi-part type (e.g. `MultiPolygon`).", + "optional": true, + "default": null, + "schema": [ + { + "type": "null" + }, + { + "type": "object", + "subtype": "geojson" + }, + { + "type": "object", + "subtype": "vector-cube" + } + ] + }, + { + "name": "num_samples", + "description": "The number of samples.\n\nThe number of samples can be given in three different ways:\n\n* An integer >= 1: The absolute number of samples to take.\n* A number > 0 and < 1: The fraction of samples to take, e.g. 0.5 to take a sample for 50% of the data. To take a sample for 100% of the data (i.e. each pixel) see the next point.\n* If not given or `null`, it takes a sample for each pixel.", + "optional": true, + "default": null, + "schema": [ + { + "title": "Absolute", + "type": "integer", + "minimum": 1 + }, + { + "title": "Fraction", + "type": "number", + "minimumExclusive": 0, + "maximumExclusive": 1 + }, + { + "title": "All", + "type": "null" + } + ] + }, + { + "name": "seed", + "description": "A randomization seed to use for random sampling. If not given or `null`, no seed is used and results may differ on subsequent use.", + "optional": true, + "default": null, + "schema": { + "type": [ + "integer", + "null" + ] + } + } + ], + "returns": { + "description": "Returns a vector data cube with the sampled points as `MultiPoint` per geometry given.", + "schema": { + "type": "object", + "subtype": "vector-cube" + } + } +}