Skip to content

Latest commit

 

History

History
54 lines (40 loc) · 1.7 KB

stconvexhull-geometry-data-type.md

File metadata and controls

54 lines (40 loc) · 1.7 KB
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
STConvexHull (geometry Data Type)
STConvexHull_TSQL
STConvexHull (geometry Data Type)
TSQL
=azuresqldb-current||>=sql-server-2016||>=sql-server-linux-2017||=azuresqldb-mi-current||=fabric

STConvexHull (geometry Data Type)

[!INCLUDE SQL Server Azure SQL Database Azure SQL Managed Instance FabricSE FabricDW]

Returns an object representing the convex hull of a geometry instance.

Syntax

  
.STConvexHull ( )  

[!INCLUDEsql-server-tsql-previous-offline-documentation]

Return Types

[!INCLUDEssNoVersion] return type: geometry

CLR return type: SqlGeometry

Remarks

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.

Examples

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();  

See Also

OGC Methods on Geometry Instances