蜂巢中的Vincenty距离

问题描述 投票:1回答:1

我可以在presto中计算vincenty距离,但对于我的一个案例,我想计算蜂巢中的vincenty距离。我搜索了一下,但我无法找到任何资料。有什么方法可以计算蜂巢中的vincenty距离。

hive hql hiveql geospatial latitude-longitude
1个回答
0
投票

看来,你可以使用下一个代码也与Impala,但也与HIVE。因此,在HIVE会比较慢。

select
  2 * asin(
      sqrt(
        cos(radians(lat1)) *
        cos(radians(lat2)) *
        pow(sin(radians((lon1 - lon2)/2)), 2)
            +
        pow(sin(radians((lat1 - lat2)/2)), 2)

      )
    ) * 6371 distance_km
  from my_table;

信用。https:/godatadriven.comlogdistance-calculation-with-impala-or-hive。

© www.soinside.com 2019 - 2024. All rights reserved.