I currently use Geohash to index some points and retrieve information faster by providing a geohash prefix for a given point for a given distance..
For example if I get a given point at '1600 Pennsylvania Ave, Washington, DC' with geohash dqcjqcpsr4t0 and I get all point that geohash starts with dqcjqc.
I would like to know if there is an algorithm and index solution to get the points ordered by the longest common segment without iterating through them all.
For example: I got a given point at '1600 Pennsylvania Ave, Washington, DC' with geohash dqcjqcpsr4t0 and I would like to get the nearest point first:
- point with geohash dqcjqfzg038b will be returned first (common prefix 'dqcjq'=>5 letters)
- point with geohash dqcjz4p344cu will be returned next (common prefix 'dqcj'=>4 letters)
The idea behind this is to get the nearest points first by providing the full (8 chars) geohash of a given point (in this case we don't use geohash to get points for a given box)