Friday, February 26, 2010

Geohashing

I came across this concept recently--it is laid out pretty well in a Wikipedia article if you want some more details.  Basically, you use it to represent a latitude/longitude pair as a single set of characters.  There are two basic features to it that are pretty cool:

  • Each successive bit of information provides additional accuracy so that the location of the point is gradually refined.  This also allows the same formula to handle various levels of precision.
  • The bits that represent latitude and longitude are interpolated with one another.  That means that a single short piece of information represents the values in two dimensions.  This is especially useful for matching and storing unique point values in a database

This is a two-way hash...a point can be encoded and decoded.  There is a loss of precision...the final representation does not match the input value exactly, but is within a defined margin of error.

It looks much better than latitude and longitude values when passed in a URL, and it is easy enough to calculate that it is amost cost-free to use.

No comments:

Post a Comment