1

我在 python 中使用 Geohash 库。考虑这段代码:

$ python
Python 2.7.6 (default, Jun 22 2015, 17:58:13) 
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import Geohash
>>> Geohash.decode("u3qcr")
('52.3', '21.1')
>>> Geohash.decode("u3qcx")
('52.3', '21.1')

为什么我得到不同哈希的相同结果?我希望我们有不同的最后一个字母,我们会得到不同的矩形。我错过了什么?

4

1 回答 1

2

在给定的精度内,两个哈希的坐标相同。查看

>>> Geohash.decode_exactly("u3qcx")
(52.31689453125, 21.07177734375, 0.02197265625, 0.02197265625)
>>> Geohash.decode_exactly("u3qcr")
(52.27294921875, 21.07177734375, 0.02197265625, 0.02197265625)
>>> 

比较如何计算四舍五入的来源Geohash.decode()

于 2016-03-19T21:54:28.233 回答