From b977aa3cdf3c697402c61fddc67b9fed0bdcdd2b Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Mon, 9 Dec 2019 02:59:25 +0300 Subject: [PATCH] Fixed error --- dbms/src/Functions/greatCircleDistance.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dbms/src/Functions/greatCircleDistance.cpp b/dbms/src/Functions/greatCircleDistance.cpp index 4fd320e8531..6f59346f0d8 100644 --- a/dbms/src/Functions/greatCircleDistance.cpp +++ b/dbms/src/Functions/greatCircleDistance.cpp @@ -157,7 +157,8 @@ float distance(float lon1deg, float lat1deg, float lon2deg, float lat2deg) if constexpr (method == Method::SPHERE) { - k_lat = 1; + k_lat = sqr(EARTH_DIAMETER * PI / 360); + k_lon = sphere_metric_lut[latitude_midpoint_index] + (sphere_metric_lut[latitude_midpoint_index + 1] - sphere_metric_lut[latitude_midpoint_index]) * (latitude_midpoint - latitude_midpoint_index); }