Skip to content

Commit

Permalink
Add raster_to_points #313
Browse files Browse the repository at this point in the history
  • Loading branch information
m-mohr committed Dec 20, 2021
1 parent ffbb927 commit 6ca3d70
Show file tree
Hide file tree
Showing 2 changed files with 86 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
81 changes: 81 additions & 0 deletions proposals/raster_to_points.json
Original file line number Diff line number Diff line change
@@ -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"
}
}
}

0 comments on commit 6ca3d70

Please sign in to comment.