Slightly offtopic - coordinate conversions

Peter Edwards peter at
Wed Jul 13 07:52:29 BST 2011

On 13 July 2011 07:16, Peter Sergeant <pete at> wrote:

> I've been playing around with Google Maps recently, and noticed that
> they've started using hashes of some coordinates:
> latlng: 52.54296 -0.308166
> hnear : 0x4877f21032e242f5:0x805cb103d71d5051
> latlng: 51.411586,-0.300893
> hnear : 0x47d8a00baf21de75:0x52963a5addd52a99
Interesting. My guess is they change the Lat/Long to the centre of its
graticule square then truncate to a fixed number of floating point places
before doing an MD5 sum.
Then you can do a quick lookup all places within a graticule square to drive
products like Google Places.

This makes for some good reading too
they gave two presentations recently about indexing geolocations and doing
polygonal (spherical) searching rather than 2D searching. Handy if you live
on the North Pole ;-)

To drag it back to Perl(ish) land

Cheers, Peter

More information about the mailing list