This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- http://dossy.org/2011/09/mysql-geo-distance-code-and-samples/ | |
DELIMITER $$ | |
DROP FUNCTION IF EXISTS geodist $$ | |
CREATE FUNCTION geodist ( | |
src_lat DECIMAL(9,6), src_lon DECIMAL(9,6), | |
dst_lat DECIMAL(9,6), dst_lon DECIMAL(9,6) | |
) RETURNS DECIMAL(6,2) DETERMINISTIC | |
BEGIN |