Skip to content

Commit

Permalink
Handle units in vector processes #330 (#436)
Browse files Browse the repository at this point in the history
* Handle units in vector processes #330

Co-authored-by: Daniel Thiex <60705209+dthiex@users.noreply.github.com>
  • Loading branch information
m-mohr and dthiex committed May 4, 2023
1 parent bab65c2 commit 32ec399
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 6 additions & 1 deletion proposals/vector_buffer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
},
{
"name": "distance",
"description": "The distance of the buffer in the unit of the spatial reference system. A positive distance expands the geometries and results in outward buffering (dilation) while a negative distance shrinks the geometries and results in inward buffering (erosion).",
"description": "The distance of the buffer in meters. If the unit of the spatial reference system is not meters, a `UnitMismatch` error is thrown. Use ``vector_reproject()`` to convert the geometries to a suitable spatial reference system.\n\nA positive distance expands the geometries and results in outward buffering (dilation) while a negative distance shrinks the geometries and results in inward buffering (erosion).",
"schema": {
"type": "number",
"not": {
Expand All @@ -42,5 +42,10 @@
}
]
}
},
"exceptions": {
"UnitMismatch": {
"message": "The unit of the spatial reference system is not meters, but the given distance is in meters."
}
}
}
7 changes: 6 additions & 1 deletion proposals/vector_to_regular_points.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
},
{
"name": "distance",
"description": "Defines the minimum distance in the unit of the reference system that is required between two samples generated *inside* a single geometry.\n\n- For **polygons**, the distance defines the cell sizes of a regular grid that starts at the upper-left bound of each polygon. The centroid of each cell is then a sample point. If the centroid is not enclosed in the polygon, no point is sampled. If no point can be sampled for the geometry at all, the first coordinate of the geometry is returned as point.\n- For **lines** (line strings), the sampling starts with a point at the first coordinate of the line and then walks along the line and samples a new point each time the distance to the previous point has been reached again.\n- For **points**, the point is returned as given.",
"description": "Defines the minimum distance in meters that is required between two samples generated *inside* a single geometry. If the unit of the spatial reference system is not meters, a `UnitMismatch` error is thrown. Use ``vector_reproject()`` to convert the geometries to a suitable spatial reference system.\n\n- For **polygons**, the distance defines the cell sizes of a regular grid that starts at the upper-left bound of each polygon. The centroid of each cell is then a sample point. If the centroid is not enclosed in the polygon, no point is sampled. If no point can be sampled for the geometry at all, the first coordinate of the geometry is returned as point.\n- For **lines** (line strings), the sampling starts with a point at the first coordinate of the line and then walks along the line and samples a new point each time the distance to the previous point has been reached again.\n- For **points**, the point is returned as given.",
"schema": {
"type": "number",
"minimumExclusive": 0
Expand Down Expand Up @@ -54,5 +54,10 @@
}
]
}
},
"exceptions": {
"UnitMismatch": {
"message": "The unit of the spatial reference system is not meters, but the given distance is in meters."
}
}
}

0 comments on commit 32ec399

Please sign in to comment.