安装:
pip install pygeohash
示例代码:
from pygeohash import encode, decode, geohash_approximate_distance
aa = encode(42.6, -5.6)
print(aa)
bb = encode(42.6, -5.6, precision=5)
print(bb)
cc = decode('ezs42e44yx96')
print(cc)
dd = decode('ezs42')
print(dd)
ee = geohash_approximate_distance(geohash_1='bcd3u', geohash_2='bc83n')
print(ee)
ff = geohash_approximate_distance('shi3u', 'sh83n')
print(ff)
运行结果: