By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
select version();
version() |
---|
10.3.32-MariaDB |
/* по широте 1 градус */
-- "точки" (50,120)(51,120)
-- аргумент перевернем Долгота-Широта
SELECT ST_Distance_Sphere(POINT(120, 51 ), POINT(120, 50)) AS LON_Meter;
/* по долготе 1 градус */
-- "точки" (50,121)(51,120)
-- аргумент перевернем Долгота-Широта
SELECT ST_Distance_Sphere(POINT(121, 50 ), POINT(120, 50)) AS LON_Meter;
--
SELECT ST_Distance_Sphere(POINT(125, 55 ), POINT(120, 50)) AS Sphere_Meter;
--
SELECT ST_Distance(POINT(125*111.194, 55*71.474 ), POINT(120*111.194, 50*71.474)) AS Dist_Meter;
LON_Meter |
---|
111194.68229846291 |
LON_Meter |
---|
71474.03168200726 |
Sphere_Meter |
---|
650514.6537793479 |
Dist_Meter |
---|
660.9205381889714 |
-- ОСЛО
set @x1 = 59.871615914096544; -- широта
set @y1 = 10.732875010123138; -- долгота
-- Стокгольм
set @x2 = 59.28192441905507; -- широта
set @y2 = 18.082728206254334; -- долгота
-- distance + Koef + 2%
SELECT ST_Distance(POINT(@y1*111194/2, @x1*71474),
POINT(@y2*111194/2, @x2*71474))*1.02 AS Dist_Meter;
-- distance_sphere
SELECT ST_Distance_Sphere(POINT(@y1, @x1), POINT(@y2, @x2)) AS Sphere_Meter;
Dist_Meter |
---|
419013.6222875411 |
Sphere_Meter |
---|
418785.6180850169 |