I am setting up a Geometry Collection in a MySql database. I have added various geometry classes thus:
SET @g ='GEOMETRYCOLLECTION(POINT(1 1),LINESTRING(0 1,2 3,4 5), POINT(6 6))'; INSERT INTO myTable (geoCollectionField) VALUES (GeomFromText(@g));
The geoCollectionField
responds as expected in the WKT formay:
GEOMETRYCOLLECTION(POINT(1 1),LINESTRING(0 1,2 3,4 5),POINT(6 6))
I can fetch the data from this Geometry Collection in several ways.
SELECT geoCollectionField FROM myTable;
gives the complete GEOMETRYCOLLECTION(POINT(1 1),LINESTRING...
SELECT AsText(GeometryN(geoCollectionField, 1)) FROM myTable;
gives the indexed geometry class POINT(1 1).
I have not been able to write a SELECT that fetches only one class type, for example the POINT classes to end up with POINT((1 1),(6 6)).
Any thoughts?