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 %}