Skip to content

Latest commit

 

History

History
67 lines (52 loc) · 2.1 KB

File metadata and controls

67 lines (52 loc) · 2.1 KB
title ConvexHullAggregate (geometry Data Type)
description ConvexHullAggregate (geometry Data Type)
author MladjoA
ms.author mlandzic
ms.date 08/03/2017
ms.service sql
ms.subservice t-sql
ms.topic reference
ms.custom
ignite-2024
helpviewer_keywords
ConvexHullAggregate method (geometry)
dev_langs
TSQL

ConvexHullAggregate (geometry Data Type)

[!INCLUDE SQL Server Azure SQL Database Azure SQL Managed Instance FabricSQLDB]

Returns a convex hull for a given set of geometry objects.

Syntax

  
ConvexHullAggregate ( geometry_operand )  

Arguments

geometry_operand
Is a geometry type table column that represents a set of geometry objects.

Return Types

[!INCLUDEssNoVersion] return type: geometry

Exception

Throws a FormatException when there are input values that are not valid. See STIsValid (geometry Data Type)

Remarks

Method returns null when the input is empty or the input has different SRIDs. See Spatial Reference Identifiers (SRIDs)

Method ignores null inputs.

Note

Method returns null if all inputted values are null.

Examples

The following example returns a convex hull of the set of geometry objects in a table variable column.

-- Setup table variable for ConvexHullAggregate example  
DECLARE @Geom TABLE  
(  
shape geometry,  
shapeType nvarchar(50)  
)  
INSERT INTO @Geom(shape,shapeType) VALUES('CURVEPOLYGON(CIRCULARSTRING(2 3, 4 1, 6 3, 4 5, 2 3))', 'Circle'),  
('POLYGON((1 1, 4 1, 4 5, 1 5, 1 1))', 'Rectangle');  
-- Perform ConvexHullAggregate on @Geom.shape column  
SELECT geometry::ConvexHullAggregate(shape).ToString()  
FROM @Geom;

See Also

Extended Static Geometry Methods