http://tieba.baidu.com/p/1262843422
////////////////////
set global log_bin_trust_function_creators=1;
CREATE FUNCTION GetDistance
(lng1 float,lat1 float,lng2 float,lat2 float) RETURNS float
BEGIN
set @num=2 * 6378.137 * ASIN(SQRT(POW(SIN(PI() * (lat1 - lat2) / 360), 2) + COS(PI() * lat1 / 180) COS(lat2 PI() / 180) * POW(SIN(PI() * (lng1 - lng2) / 360), 2)));
RETURN @num*1000;
END
http://www.aiezu.com/db/mysql_gps_distance.html
====================
oracle
http://www.cnblogs.com/microsoft-jiang/archive/2008/07/24/1250644.html
时间: 2024-10-29 12:55:24