Funções de Análise das Propriedades de GeometryCollection
NumGeometries(gc)
Retorna o número de geometrias no valor GeometryCollection 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)Retorna o
n-ésima geometria no valorGeometryCollectiongc. O número de geometrias começa em 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) | +------------------------------------------------------------------------------------------+
Nota: Funções para tipos de geometrias específicas retornam NULL se a geomtria passada é do tipo de geometria errado. Por exemplo Area() retorna NULL se o tipo do objeto não é nem Polygon nem MultiPolygon.