ConvexHullAggregate (tipo de dados geometry)
Retorna uma forma convexa para um determinado conjunto de objetos geometry.
Sintaxe
ConvexHullAggregate ( geometry_operand )
Argumentos
- geometry_operand
É uma coluna de tabela de tipo geometry que representa o conjunto de objetos geometry.
Tipos de retorno
SQL Server tipo de retorno: geometry
Exceção
Gera uma FormatException quando há valores de entrada que não são válidos. Consulte STIsValid (tipo de dados geometry)
Comentários
O método retornará null quando a entrada estiver vazia ou tiver SRIDs diferentes. Consulte SRIDs (Spatial Reference Identifiers)
O método ignora entradas null.
![]() |
---|
O método retornará null se todos os valores inseridos forem null. |
Exemplos
O exemplo a seguir retorna uma forma convexa do conjunto de objetos geometry em uma coluna de variável de tabela.
-- 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;