[英]How to store (latitude, longitude, altitude) tuple in MySQL database?
Use a POINT for the latitude and longitude, and a DECIMAL for the altitude:使用 POINT 表示纬度和经度,使用 DECIMAL 表示高度:
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;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.