Geospatial User Guide > Geospatial User Guide > Geospatial Data Types > Three-dimensional Data Types > GeometryCollectionZ and GeometryCollectionM Data Types
Was this helpful?
GeometryCollectionZ and GeometryCollectionM Data Types
GeometryCollectionZ and GeometryCollectionM have the same properties as GeometryCollection with the exception that GeometryCollectionZ can only contain geometries with a Z coordinate and GeometryCollectionM can only contain geometries with an M coordinate.
Examples:
Without specifying SRID:
CREATE TABLE mishmash1 (name VARCHAR(30), path GEOMETRYCOLLECTIONZ);
CREATE TABLE mishmash2 (name VARCHAR(30), path GEOMETRYCOLLECTIONM);
With specifying SRID:
CREATE TABLE mishmash1 (name VARCHAR(30), path GEOMETRYCOLLECTIONZ SRID 4326);
CREATE TABLE mishmash2 (name VARCHAR(30), path GEOMETRYCOLLECTIONM SRID 4326);
Geometry collections can mix singular Z types:
CREATE TABLE collections1 (id INTEGER PRIMARY KEY, collection GEOMETRYCOLLECTIONZ);
INSERT INTO collections1 (id, collection) VALUES (1, GEOMZFROMTEXT('GEOMETRYCOLLECTIONZ( POLYGONZ ((0 0 5, 10 10 10, 0 10 0, 0 0 5)), POLYGONZ ((0 0 0, 10 10 10, 10 0 5, 0 0 0)))'));
INSERT INTO collections1 (id, collection) VALUES (2, GEOMZFROMTEXT('GEOMETRYCOLLECTIONZ( POLYGONZ ((0 0 5, 10 10 10, 0 10 0, 0 0 5)), POINTZ (50 50 25))'));
Geometry collections can mix singular M types:
CREATE TABLE collections2 (id INTEGER PRIMARY KEY, collection GEOMETRYCOLLECTIONZ);
INSERT INTO collections2 (id, collection) VALUES (1, GEOMMFROMTEXT('GEOMETRYCOLLECTIONM( POLYGONM ((0 0 5, 10 10 10, 0 10 0, 0 0 5)), POLYGONM ((0 0 0, 10 10 10, 10 0 5, 0 0 0)))'));
INSERT INTO collections2 (id, collection) VALUES (2, GEOMMFROMTEXT('GEOMETRYCOLLECTIONM( POLYGONM ((0 0 5, 10 10 10, 0 10 0, 0 0 5)), POINTM (50 50 25))'));
Last modified date: 08/28/2024