There are ways to store latitude and longitude as Point in MySQL database, but how can I store a tuple for (latitude, longitude, altitude) in MySQL database?
There are ways to store latitude and longitude as Point in MySQL database, but how can I store a tuple for (latitude, longitude, altitude) in MySQL database?
Use a POINT for the latitude and longitude, and a DECIMAL for the altitude:
CREATE TABLE Mountain (
Location POINT NOT NULL, -- Latitude/longitude
Altitude DECIMAL(12, 2) -- Altitude or height in meters or feet or furlongs if you prefer
) ENGINE=InnoDB;
or, just use three decimals - one for latitude, one for longitude, one for altitude:
CREATE TABLE Mountain (
Latitude DECIMAL(10, 7),
Longitude DECIMAL(10, 7),
Altitude DECIMAL(11, 1)
) ENGINE=InnoDB;