sql 计算两个点之间之间的距离 mysql

昀:
select *,ACOS(SIN((#{lat} * 3.1415) / 180 ) *SIN((substring(points,’,’,-1) * 3.1415) / 180 ) +COS((#{lat} * 3.1415) / 180 ) * COS((substring(points,’,’,-1) * 3.1415) / 180 ) *COS((#{lon} * 3.1415) / 180 - (substring(points,’,’,1) * 3.1415) / 180 ) ) * 6378140 dis
FROM t_store
where active=1
order by dis
limit #{page},#{pageSize};

昀:
lat是代表纬度,lon是代表经度,substring(points,’,’,-1)是纬度,substring(points,’,’,-1)是经度

你可能感兴趣的:(Echarts)