Fantastic! This is exactly what I was looking for. I also found this
On Apr 15, 10:24 pm, barryhunter <
BarryBHun...@googlemail.com> wrote:
> I think a good (cheap and chearful) way would be with geohashs
>
>
http://geohash.org/
>
> Encode[1] your location as a hash and store as a string.
>
> But the magic is expressed by this statement:
> "Geohashes offer properties like arbitrary precision, similar prefixes
> for nearby positions, and the possibility of gradually removing
> characters from the end of the code to reduce its size (and gradually
> lose precision)."
>
> So you can search by prefix[2] to find points in a box, make it quite
> short and you will get the area. If you want you could also check the
> surrounding boxes - I admit the maths could be tricky there, but
> should be doable. (would have to do multiple queries as you dont have
> 'OR' in the dartastore.)
>
> This basically equates to a poormans QuadTree index, which would be
> the correct way to do it.
>
> (If I get the time will actully try this out! - maybe as an addon to
> the geodatastore?)
>
> [1] the above site offers an API, that you could call with the fetch
> API, or there is a PHP class:
http://blog.dixo.net/2008/02/28/geohash-php-class/
> which should be portable to Python fairly easily.
>