Udostępnij przez


CollectionAggregate (geometry Data Type)

Creates a GeometryCollection instance from a set of geometry types.

Składnia

CollectionAggregate ( geometry_operand )

Arguments

  • geometry_operand
    Is a geometry type table column that represents a set of geometry objects to be listed in the GeometryCollection instance.

Return Types

SQL Server return type: geometry

Wyjątki

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

Uwagi

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

Method ignores null inputs.

[!UWAGA]

Method returns null if all inputted values are null.

Examples

The following example returns a GeometryCollection instance that contains a CurvePolygon and a 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;

Zobacz także

Inne zasoby

Extended Static Geometry Methods