[英]How to store (latitude, longitude, altitude) tuple in MySQL database?
使用 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;
或者,只使用三位小數 - 一位代表緯度,一位代表經度,一位代表高度:
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.