代码之家  ›  专栏  ›  技术社区  ›  trndjc

为什么geohashs不是完美的正方形?

  •  1
  • trndjc  · 技术社区  · 6 年前

    enter image description here

    1 回复  |  直到 6 年前
        1
  •  1
  •   rfestag    6 年前

    从根本上讲,问题是如何将球体上的坐标映射到二维空间。当你离开赤道时,坐标变得更为“矩形”,因为在纬度和经度变化相等的物理差异之间有更大的差异。这种非线性行为在本文中得到了很好的解释 Wikipedia 文章。我在这里包括了相关部分:

    由于geohash(在这个实现中)是基于经度和纬度的坐标的,所以两个geohash之间的距离反映了两个点之间的纬度/经度坐标距离,而这并不能转化为实际距离,请参见Haversine公式。

    At the Equator (0 Degrees) the length of a degree of longitude is 111.320 km, while a degree of latitude measures 110.574 km, an error of 0.67%.
    At 30 Degrees (Mid Latitudes) the error is 110.852/96.486 = 14.89%
    At 60 Degrees (High Arctic) the error is 111.412/55.800 = 99.67%, reaching infinity at the poles.
    
    推荐文章