Condividi tramite


CollectionAggregate (tipo di dati geometry)

Crea un'istanza GeometryCollection da un set di tipi geometry.

Sintassi

CollectionAggregate ( geometry_operand )

Argomenti

  • geometry_operand
    Colonna della tabella di tipo geometry che rappresenta un set di oggetti geometry da elencare nell'istanza GeometryCollection.

Tipi restituiti

SQL Server - tipo restituito: geometry

Eccezioni

Genera un'eccezione FormatException in presenza di valori di input non validi. Vedere STIsValid (tipo di dati geometry)

Osservazioni

Il metodo restituisce null quando l'input è vuoto o dispone di SRID diversi. Vedere Identificatori SRID (Spatial Reference Identifier)

Il metodo ignora gli input null.

[!NOTA]

Il metodo restituisce null se tutti i valori immessi sono null.

Esempi

Nell'esempio seguente viene restituita un'istanza GeometryCollection che contiene CurvePolygon e Polygon.

-- Setup table variable for CollectionAggregate 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 CollectionAggregate on @Geom.shape column

SELECT geometry::CollectionAggregate(shape).ToString()

FROM @Geom;

Vedere anche

Altre risorse

Metodi di geometria statici estesi