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 阅读全文>>