Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Applies to: Databricks Runtime 17.1 and above
Important
This feature is in Public Preview.
Returns the concave hull of the input GEOMETRY
as a GEOMETRY
using the specified length ratio.
Syntax
st_concavehull ( geoExpr, lengthRatioExpr[, allowHolesExpr])
Arguments
geoExpr
: AGEOMETRY
value.lengthRatio
- ADOUBLE
value between0
and1
, inclusive, representing the length ratio used to compute the concave hull.allowHoles
- An optionalBOOLEAN
value, indicating whether the output geometry, if a polygon, is allowed to have holes. The default value is false.
Returns
Returns a GEOMETRY
that is the concave hull of the input GEOMETRY
using the specified length
ratio. The resulting geometry, if a polygon, is allowed to have holes iff the third argument
is set to true.
The SRID value of the output GEOMETRY
is equal to that of the input GEOMETRY
.
An error is returned if the length ratio is not between 0 and 1, inclusive.
The length ratio determines a threshold based on the range between the shortest and longest edges in the Delaunay triangulation of the input points. Edges longer than this threshold are removed from the triangulation. The remaining triangles define the concave hull.
For areal input geometries (polygons or multipolygons), the algorithm uses a constrained Delaunay triangulation. The resulting concave hull respects the input GEOMETRY
and includes its original polygons.
Examples
> SELECT st_astext(st_concavehull(st_geomfromtext('MULTIPOINT(0 0,10 0,10 10,0 10,1 1,1 5,1 9,5 1,9 9,9 1,9 5,5 9)'), 1))
POLYGON((0 0,0 10,10 10,10 0,0 0))
> SELECT st_astext(st_concavehull(st_geomfromtext('MULTIPOINT(0 0,10 0,10 10,0 10,1 1,1 5,1 9,5 1,9 9,9 1,9 5,5 9)'), 0.8))
POLYGON((0 0,1 5,0 10,5 9,10 10,9 5,10 0,5 1,0 0))