Geometry
Property Analysis Functions
Point
Property Analysis Functions
LineString
Property Analysis Functions
MultiLineString
Property Analysis Functions
Polygon
Property Analysis Functions
MultiPolygon
Property Analysis Functions
GeometryCollection
Property Analysis Functions
GeometryCollection
Property Analysis FunctionsNumGeometries(gc)
GeometryCollection
value
gc
.
mysql> SELECT NumGeometries(GeomFromText('GeometryCollection(Point(1 1),LineString(2 2, 3 3))')); +------------------------------------------------------------------------------------+ | NumGeometries(GeomFromText('GeometryCollection(Point(1 1),LineString(2 2, 3 3))')) | +------------------------------------------------------------------------------------+ | 2 | +------------------------------------------------------------------------------------+
GeometryN(gc,n)
n
-th geometry in the GeometryCollection
value
gc
. Geometry numbers begin at 1.
mysql> SELECT AsText(GeometryN(GeomFromText('GeometryCollection(Point(1 1),LineString(2 2, 3 3))'),1)); +------------------------------------------------------------------------------------------+ | AsText(GeometryN(GeomFromText('GeometryCollection(Point(1 1),LineString(2 2, 3 3))'),1)) | +------------------------------------------------------------------------------------------+ | POINT(1 1) | +------------------------------------------------------------------------------------------+