12.15.7.7 GeometryCollection 프로퍼티 함수
이 함수는 GeometryCollection 값 특성을 반환합니다.
GeometryN(gc,N)GeometryCollection값gc의N번째 기하 도형을 반환합니다. 기하 도형의 번호는 1부터 시작합니다.mysql>
SET @gc = 'GeometryCollection(Point(1 1),LineString(2 2, 3 3))';mysql>SELECT AsText(GeometryN(GeomFromText(@gc),1));+----------------------------------------+ | AsText(GeometryN(GeomFromText(@gc),1)) | +----------------------------------------+ | POINT(1 1) | +----------------------------------------+NumGeometries(gc)GeometryCollection값gc의 기하학적 도형의 수를 돌려줍니다.mysql>
SET @gc = 'GeometryCollection(Point(1 1),LineString(2 2, 3 3))';mysql>SELECT NumGeometries(GeomFromText(@gc));+----------------------------------+ | NumGeometries(GeomFromText(@gc)) | +----------------------------------+ | 2 | +----------------------------------+