다음을 통해 공유


CollectionAggregate(geometry 데이터 형식)

geometry 형식 집합에서 GeometryCollection 인스턴스를 만듭니다.

구문

CollectionAggregate ( geometry_operand )

인수

  • geometry_operand
    GeometryCollection 인스턴스에 나열할 geometry 개체 집합을 나타내는 geometry 형식 테이블 열입니다.

반환 형식

SQL Server 반환 형식: geometry

예외

유효하지 않은 입력 값이 있는 경우 FormatException을 발생시킵니다. STIsValid(geometry 데이터 형식)를 참조하십시오.

주의

이 메서드는 입력이 비어 있거나 입력에 다른 SRID가 있는 경우 null을 반환합니다. SRID(Spatial Reference Identifier)를 참조하십시오.

이 메서드는 null 입력을 무시합니다.

[!참고]

이 메서드는 모든 입력 값이 null인 경우 null을 반환합니다.

다음 예는 CurvePolygon 및 Polygon을 포함하는 GeometryCollection 인스턴스를 반환합니다.

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

참고 항목

관련 자료

확장 정적 기하 도형 메서드