首页 > 代码库 > 指定经纬度与数据库多条经纬度进行距离计算

指定经纬度与数据库多条经纬度进行距离计算

##121.308364,30.225778 示例对比的坐标select * from broadcasts where location!=‘‘ and sqrt(      (       ((121.308364-longitude)*PI()*12656*cos(((30.225778+latitude)/2)*PI()/180)/180)       *       ((121.308364-longitude)*PI()*12656*cos (((30.225778+latitude)/2)*PI()/180)/180)      )      +      (       ((30.225778-latitude)*PI()*12656/180)       *       ((30.225778-latitude)*PI()*12656/180)      )  )<20

 

指定经纬度与数据库多条经纬度进行距离计算