4. Geospatial Data Types : Three-dimensional Data Types : PointZ and PointM Data Types
 
Share this page                  
PointZ and PointM Data Types
PointZ and PointM have the same properties as the Point data type except they contain one more ordinate. The Z is the elevation and the M is the measurement. Syntactically these types are similar.
Examples:
Without specifying SRID:
CREATE TABLE houses (id VARCHAR(30), location POINTZ);
CREATE TABLE treees (id VARCHAR(30), location POINTM);
With specifying SRID:
CREATE TABLE houses (id VARCHAR(30), location POINTZ SRID 4326);
CREATE TABLE treees (id VARCHAR(30), location POINTM SRID 4326);
Use X, Y, and Z coordinates to represent houses:
CREATE TABLE houses (id INTEGER PRIMARY KEY, location POINTZ NOT NULL );
INSERT INTO houses (id, location) VALUES (1, GEOMFROMTEXT('POINTZ(5 10 150)'));
Use X, Y, and M coordinates to represent trees, where M is the height of the tree in meters:
CREATE TABLE trees (id INTEGER PRIMARY KEY, location POINTM NOT NULL );
INSERT INTO trees (id, location) VALUES (1, GEOMFROMTEXT('POINTM(5 10 15)'));