From a4db0f34d599ea95644160e73fac14a09bababfd Mon Sep 17 00:00:00 2001 From: Bastien Boutonnet Date: Sun, 14 Mar 2021 10:49:17 +0100 Subject: [PATCH] make implementation with pow() default --- macros/geo/haversine_distance.sql | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/macros/geo/haversine_distance.sql b/macros/geo/haversine_distance.sql index eae366def..ecd6756d8 100644 --- a/macros/geo/haversine_distance.sql +++ b/macros/geo/haversine_distance.sql @@ -14,20 +14,6 @@ The arguments should be float type. {# vanilla macro is in miles #} {% set conversion_rate = '' %} {% if unit == 'km' %} -{# we multiply miles result to get it in kms #} - {% set conversion_rate = '* 1.60934' %} -{% endif %} - - 2 * 3961 * asin(sqrt((sin(radians(({{lat2}} - {{lat1}}) / 2))) ^ 2 + - cos(radians({{lat1}})) * cos(radians({{lat2}})) * - (sin(radians(({{lon2}} - {{lon1}}) / 2))) ^ 2)) {{conversion_rate}} - -{%- endmacro %} - -{% macro snowflake__haversine_distance(lat1,lon1,lat2,lon2,unit) -%} -{# vanilla macro is in miles #} - {% set conversion_rate = '' %} -{% if unit == 'km' %} {# we multiply miles result to get it in kms #} {% set conversion_rate = '* 1.60934' %} {% endif %}