MySQL 5.6 Reference Manual Including MySQL NDB Cluster 7.3-7.4 Reference Guide
These functions return properties of
GeometryCollection
values.
ST_GeometryN()
and
GeometryN()
are synonyms. For
more information, see the description of
ST_GeometryN()
.
ST_NumGeometries()
and
NumGeometries()
are synonyms.
For more information, see the description of
ST_NumGeometries()
.
Returns the N
-th geometry in the
GeometryCollection
value
gc
. Geometries are numbered
beginning with 1. If any argument is NULL
or the geometry argument is an empty geometry, the return
value is NULL
.
mysql>SET @gc = 'GeometryCollection(Point(1 1),LineString(2 2, 3 3))';
mysql>SELECT ST_AsText(ST_GeometryN(ST_GeomFromText(@gc),1));
+-------------------------------------------------+ | ST_AsText(ST_GeometryN(ST_GeomFromText(@gc),1)) | +-------------------------------------------------+ | POINT(1 1) | +-------------------------------------------------+
ST_GeometryN()
and
GeometryN()
are synonyms.
Returns the number of geometries in the
GeometryCollection
value
gc
. If the argument is
NULL
or an empty geometry, the return
value is NULL
.
mysql>SET @gc = 'GeometryCollection(Point(1 1),LineString(2 2, 3 3))';
mysql>SELECT ST_NumGeometries(ST_GeomFromText(@gc));
+----------------------------------------+ | ST_NumGeometries(ST_GeomFromText(@gc)) | +----------------------------------------+ | 2 | +----------------------------------------+
ST_NumGeometries()
and
NumGeometries()
are synonyms.