1. 程式人生 > >MYSQL 查詢指定範圍內的經緯度

MYSQL 查詢指定範圍內的經緯度

經緯 location code long div clas 經緯度 cat sele

select * from `location` where (
acos(
sin(([#latitude#]*3.1415)/180) * sin((latitude*3.1415)/180) + 
cos(([#latitude#]*3.1415)/180) * cos((latitude*3.1415)/180) * cos(([#longitude#]*3.1415)/180 - (longitude*3.1415)/180)
)*6370.996
)<=1;

MYSQL 查詢指定範圍內的經緯度