嗯,我geohash_encoded地理坐标到地理哈希。我的目的是在一定程度上精确计算距离。我正在尝试将地理哈希返回到地理坐标,但我没有想出一个函数,可以对数据帧中的列执行此操作。
发布于 2019-05-18 22:57:11
假设:
dfdf有一个名为geohash的列,它包含您的地理哈希。geohash2库(这可以与其他Geo散列库一起使用.)df和longitude列的新DataFrame覆盖latitude。下列措施应能发挥作用:
def gh_decode(hash):
lat, lon = geohash2.decode(hash)
return pd.Series({"latitude":lat, "longitude":lon})
df = df.join(df["geohash"].apply(gh_decode))https://stackoverflow.com/questions/55951182
复制相似问题