title | description | author | ms.author | ms.date | ms.service | ms.subservice | ms.topic | f1_keywords | helpviewer_keywords | dev_langs | monikerRange | ||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
STConvexHull (geometry Data Type) |
STConvexHull (geometry Data Type) |
MladjoA |
mlandzic |
08/03/2017 |
sql |
t-sql |
reference |
|
|
|
=azuresqldb-current||>=sql-server-2016||>=sql-server-linux-2017||=azuresqldb-mi-current |
[!INCLUDE SQL Server Azure SQL Database Azure SQL Managed Instance]
Returns an object representing the convex hull of a geometry instance.
.STConvexHull ( )
[!INCLUDEssNoVersion] return type: geometry
CLR return type: SqlGeometry
STConvexHull()
returns the smallest convex polygon that contains the given geometry instance. Points or co-linear LineString instances will produce an instance of the same type as that of the input.
The following example uses STConvexHull()
to find the convex hull of a non-convex Polygon``geometry
instance.
DECLARE @g geometry;
SET @g = geometry::STGeomFromText('POLYGON((0 0, 0 2, 1 1, 2 2, 2 0, 0 0))', 0);
SELECT @g.STConvexHull().ToString();