Was this helpful?
PolygonZ and PolygonM Data Types
The PolygonZ and PolygonM have the same properties as Polygon but with one additional ordinate.
Examples:
Without specifying SRID
CREATE TABLE lots (name VARCHAR(30), lot POLYGONZ);
CREATE TABLE floors (name VARCHAR(30), floor POLYGONM);
With specifying SRID
CREATE TABLE lots (name VARCHAR(30), lot POLYGONZ SRID 4326);
CREATE TABLE floors (name VARCHAR(30), floor POLYGONM SRID 4326);
Use polygons to represent the properties:
CREATE TABLE lots (id INTEGER PRIMARY KEY, area POLYGONZ NOT NULL);
INSERT INTO lots (id, area) VALUES (1, GEOMZFROMTEXT('POLYGONZ((0 10 0, 1 10 5, 1 1 5, 10 1 5, 10 0 0, 0 0 0, 0 10 0))'));
Use polygons to represent floors of a building where M is floor number:
CREATE TABLE floors (id INTEGER PRIMARY KEY, floor POLYGONM NOT NULL);
INSERT INTO floors (id, floor) VALUES (1, GEOMMFROMTEXT('POLYGONM((0 0 1, 0 10 1, 10 10 1, 10 0 1, 0 0 1))'));
INSERT INTO floors (id, floor) VALUES (2, GEOMMFROMTEXT('POLYGONM((0 0 2, 0 10 2, 10 10 2, 10 0 2, 0 0 2))'));
Last modified date: 11/09/2022