ClickHouse/tests/queries/0_stateless/00362_great_circle_distance.sql

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

14 lines
973 B
MySQL
Raw Normal View History

2016-08-15 15:00:02 +00:00
SELECT floor(greatCircleDistance(33.3, 55.3, 33.3, 55.3)) AS distance;
2019-10-18 15:03:15 +00:00
-- consts are from vincenty formula from geopy
-- k = '158.756175, 53.006373'
-- u = '37.531014, 55.703050'
-- y = '37.588144, 55.733842'
-- m = '37.617780, 55.755830'
-- n = '83.089598, 54.842461'
2019-10-21 09:37:50 +00:00
select abs(greatCircleDistance(37.531014, 55.703050, 37.588144, 55.733842) - 4964.25740448) / 4964.25740448 < 0.004;
select abs(greatCircleDistance(37.531014, 55.703050, 37.617780, 55.755830) - 8015.52288508) / 8015.52288508 < 0.004;
select abs(greatCircleDistance(37.588144, 55.733842, 37.617780, 55.755830) - 3075.27332275) / 3075.27332275 < 0.004;
select abs(greatCircleDistance(83.089598, 54.842461, 37.617780, 55.755830) - 2837839.72863) / 2837839.72863 < 0.004;
select abs(greatCircleDistance(37.617780, 55.755830, 158.756175, 53.006373) - 6802821.68814) / 6802821.68814 < 0.004;
select abs(greatCircleDistance(83.089598, 54.842461, 158.756175, 53.006373) - 4727216.39539) / 4727216.39539 < 0.004;