Answer the question
In order to leave comments, you need to log in
MariaDB st_distance_sphere?
CREATE FUNCTION `st_distance_sphere`(`pt1` POINT, `pt2` POINT)
RETURNS DOUBLE(10, 2)
return 6371000 * 2 * ASIN(SQRT(
POWER(SIN((ST_Y(pt2) - ST_Y(pt1)) * pi() / 180 / 2),
2) + COS(ST_Y(pt1) * pi() / 180) * COS(ST_Y(pt2) *
pi() / 180) *
POWER(SIN((ST_X(pt2) - ST_X(pt1)) *
pi() / 180 / 2), 2)));
MariaDB [shlagsher]> SELECT st_distance_sphere(ST_GeomFromText('POINT(55.743571 37.621438)', 4326),
ST_GeomFromText('POINT(55.744235 37.624855)')) r;
+--------+
| r |
+--------+
| 384.43 |
+--------+
1 row in set (0.00 sec)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question