后台给的经纬度坐标
有这样的 111°29’66" 40°49’20"
也有这样的 112.1812 40.1587
统一要这样的 112.1812 40.1587
度分秒转度数 : aaa°bb’c" = aaa+bb/60+c/60/60
读书转度分秒 : 112.1812 = 112°
0.1812 * 60 = 10.872 取10’
0.872 * 60 = 52.32
得 112°10’52.32’’
没找到合适的案例 只能硬怼
select
if(INSTR(lon, '°'),
substring(lon, 1, INSTR(lon, '°') - 1) +
substring(lon, INSTR(lon, '°') + 1, INSTR(lon, '''') - INSTR(lon, '°') - 1) / 60 +
substring(lon, INSTR(lon, '''') + 1, INSTR(lon, '"') - INSTR(lon, '''') - 1) / 60 / 60
, lon) longitude,
if(INSTR(lat, '°'),
substring(lat, 1, INSTR(lat, '°') - 1) +
substring(lat, INSTR(lat, '°') + 1, INSTR(lat, '''') - INSTR(lat, '°') - 1) / 60 +
substring(lat, INSTR(lat, '''') + 1, INSTR(lat, '"') - INSTR(lat, '''') - 1) / 60 / 60
, lat) latitude
from xxxTable