Skip to content

Instantly share code, notes, and snippets.

View piffall's full-sized avatar
🏠
Working from home

Cristòfol Torrens piffall

🏠
Working from home
View GitHub Profile
-- 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