JavadocMD / simplelatlng

A simple, lightweight library for common latitude and longitude calculation needs in Java.
89 stars 20 forks source link

geohash implementation issue : decode(hash(X)) != X #7

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The following JUnit fails :
assertEquals(new LatLng(44.869797, 6.599944), 
Geohasher.decode(Geohasher.hash(new LatLng(44.869797, 6.599944))));

I was assuming that Geohasher.decode(Geohasher.hash(X))) equals X. Is that true 
? 
The geohash precision is the default 12 characters. 
simplelatlng-1.1.0.

It may be a rounding issue, as the computed latitude from geohash decode, 
before new Latlng(x, y) is  44.869,796,94105685 and expected result is 
44.869,797. see Geohash.decode:83.

Best regards,
-Leo

Original issue reported on code.google.com by leo.flan...@heliorama.fr on 5 Jun 2013 at 7:40

GoogleCodeExporter commented 9 years ago
Thanks for bringing this up. Working on an appropriate fix.

Original comment by TylerCo...@gmail.com on 10 Jun 2013 at 7:27

GoogleCodeExporter commented 9 years ago
Fixed for v1.3.0

Original comment by TylerCo...@gmail.com on 2 Jul 2013 at 5:16