harsha2010/python-geohash

geohash.encode returns different results if c library is used

Closed this issue · 1 comments

What steps will reproduce the problem?
1. Try the geohash.encode method on the same coordinates with the _geohash c
library present and without

What is the expected output? What do you see instead?

Without _geohash C library:

>>> geohash.encode(63.537551615736049, -135.59328029278211)
'bgr96qxvpd46'

With _geohash C library:

>>> geohash.encode(63.537551615736049, -135.59328029278211)
'bgr96qsj0444'

What version of the product are you using? On what operating system?

python-geohash 0.6, python 2.6.1, OS X 10.6

Please provide any additional information below.

I'm pretty sure the response when using pure Python is the correct one (as the 
result when decoding has the least error). When I decode both of these 
responses, it looks like the error is in the longitude only (as the latitudes 
match):

>>> geohash.decode('bgr96qxvpd46')
(63.537551583722234, -135.59327999129891)
>>> geohash.decode('bgr96qsj0444')
(63.537551583722234, -135.59875203296542)

Original issue reported on code.google.com by wsimm...@gmail.com on 25 Aug 2010 at 11:47

Thank you very much. I fixed the bug at rev.149, and created version 0.7.

Original comment by Hiroaki.Kawai@gmail.com on 18 Sep 2010 at 1:43

  • Changed state: Fixed