2013-1024

mysql计算GPS经纬度距离

DELIMITER $$
CREATEDEFINER=`root`@`localhost` FUNCTION`getDistance`(
lon1 float(10,7)
,lat1 float(10,7)
,lon2 float(10,7)
,lat2 float(10,7)
) RETURNSdouble
begin
declared double;
declareradius int;
setradius = 6378140; #假设地球为正球形,直径为6378140米
setd = (2*ATAN2(SQRT(SIN((lat1-lat2)*PI()/180/2)
*SIN((lat1-lat2)*P 阅读全文>>
                
标签: mysql php 经纬度坐标距离 sqlserver mssql oracle 阅读:4637