PolygonZM Data Type
PolygonZM has the same properties as the Polygon data type but with two additional ordinates. In the WKT of PolygonZM the first ordinate is X, the second is Y, the third is Z, and the fourth is M.
Examples:
Without specifying SRID
CREATE TABLE floors (name VARCHAR(30), floor POLYGONZM);
With specifying SRID
CREATE TABLE floors (name VARCHAR(30), floor POLYGONZM SRID 4326);
Use polygons to represent floors of a building where Z is height of the ground and M is floor number:
CREATE TABLE floors (id INTEGER PRIMARY KEY, floor POLYGONZM NOT NULL);
INSERT INTO floors (id, floor) VALUES (1, GEOMZMFROMTEXT('POLYGONZM((0 0 0 1, 0 10 0 1, 10 10 0 1, 10 0 0 1, 0 0 0 1))'));
INSERT INTO floors (id, floor) VALUES (2, GEOMZMFROMTEXT('POLYGONZM((0 0 3 2, 0 10 3 2, 10 10 3 2, 10 0 3 2, 0 0 3 2))'));
Last modified date: 11/09/2022