ST_GEOMETRYN
Returns the N-th geometry in a GeometryCollection. Geometries are numbered beginning with 1.
Syntax
ST_GeometryN(gc,N)
GeometryN(gc,N)Description
Example
SET @gc = 'GeometryCollection(Point(1 1),LineString(12 14, 9 11))';
SELECT AsText(GeometryN(GeomFromText(@gc),1));
+----------------------------------------+
| AsText(GeometryN(GeomFromText(@gc),1)) |
+----------------------------------------+
| POINT(1 1) |
+----------------------------------------+Last updated
Was this helpful?

