News for hackers. Stuff that matters.
Re:Geohash: text representation allows you to sort locations... by qwerta on Saturday August 23, 2014 @07:38AM (#8215564)
If you like this stuff, have a look at Healpix: http://healpix.sourceforge.net/ It splits sphere into pixels each with separate number. It is sort of fast hashing for spherical purposes in astronomy. It does not require trigonometric operations and is very fast.
Re:Geohash: text representation allows you to sort locations... by e98cuenc on Saturday August 23, 2014 @04:04AM (#8215290)
There is another free library to do that, among other things, by Google. It's not well known, but it was used all over the place internally (at least by the geo team).

https://code.google.com/p/s2-geometry-library/

The key difference with geohash is that it uses a Hilbert curve instead of a z-curve and it projects the world in a cube instead of using directly cartesian coordinates.

Re:Geohash: text representation allows you to sort locations... by nroets on Saturday August 23, 2014 @04:33AM (#8215321)
It only attempts to "allow you to sort locations by proximity", as explained in the article.
Re:Geohash: text representation allows you to sort locations... by EGreg on Saturday August 23, 2014 @12:38PM (#8216188)
Or to get rid of fault lines you can store two geohashes - the second one shifted so between the two, you can find many more "near points".

That said, geohashes like this are bad because they rely on lat/long without normalizing for distance first

Re:Geohash: text representation allows you to sort locations... by namplaa on Saturday August 23, 2014 @03:41AM (#8215277)
When the prefix (or infix) doesn't match for something that is close it looks like the prefixes are simply inverted. So 10000 and 01111 are obviously close. I haven't verified.
Re:Geohash: text representation allows you to sort locations... by ushi on Saturday August 23, 2014 @10:29AM (#8215892)
Re:Geohash: text representation allows you to sort locations... by jamra on Saturday August 23, 2014 @12:45PM (#8216208)
Why would you link this?

It wraps around a java jar file. I can't study the code to see how it's implemented.

Re:Geohash: text representation allows you to sort locations... by hydrozen on Sunday August 24, 2014 @07:20PM (#8219977)
I believe by default it uses the C implementation which you can read here: https://github.com/davetroy/geohash/blob/master/ext/geohash_...