Skip to content

Commit

Permalink
Add vector_to_points #313
Browse files Browse the repository at this point in the history
  • Loading branch information
m-mohr committed Dec 21, 2021
1 parent 22727cc commit 1acc305
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- New processes in proposal state:
- `raster_to_points`
- `vector_to_points`

## [1.2.0] - 2021-12-13

Expand Down
2 changes: 1 addition & 1 deletion proposals/raster_to_points.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
},
{
"name": "geometries",
"description": "Input Geometries for sample extraction. If not given or `null`, the bounding box of the raster data cube is used as input polygon.\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`).",
"description": "Input geometries for sample extraction. If not given or `null`, the bounding box of the raster data cube is used as input polygon.\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": [
Expand Down
68 changes: 68 additions & 0 deletions proposals/vector_to_points.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
{
"id": "vector_to_points",
"summary": "Sample random points from geometries",
"description": "For each geometry samples a number of random points based on one of the sampling method.",
"categories": [
"cubes",
"vector"
],
"experimental": true,
"parameters": [
{
"name": "data",
"description": "Input geometries for sample extraction.\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`).",
"schema": [
{
"type": "object",
"subtype": "geojson"
},
{
"type": "object",
"subtype": "vector-cube"
}
]
},
{
"name": "count",
"description": "The number of points to compute. For each point given the maximum number of computed points is always 1.",
"optional": true,
"default": 1,
"schema": {
"type": "integer",
"minimum": 1
}
},
{
"name": "method",
"description": "The method to distribute the samples:\n\n* `random` (default): Random sampling\n* `fibonacci`: Fibonacci spiral sampling",
"optional": true,
"default": "random",
"schema": {
"type": "string",
"enum": [
"random",
"fibonacci"
]
}
},
{
"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 1acc305

Please sign in to comment.