Portrait of Edd Dumbill, taken by Giles Turnbull

Subscribe to updates

Feed icon Atom or RSS

or get email updates

What I make

expectnation
a conference management web application


XTech Conference
a European web technology conference

Goodness gracious, great circles

There are some parts of the hacker zeitgeist you hope you can ignore. For me, one of these is geolocation services. You know, GPS, mapping and suchlike. The coding seems hard and the data scarce.

No more, I'm afraid. As part of my quest to make Dashboard consume all the metadata the Web has to offer, and then a bit more, I enabled it to understand GeoURL tags. Such a tag looks like this:

  <meta name="ICBM" content="40.77017,-73.985836" />

The numbers are a latitude, longitude pair. When Dashboard comes across these now, it generates a latlong clue. One example use for this is that conference sites could put the coordinates of the venue in and software agents can automatically find things like nearby hotels, and so on.

Browsing Leigh Dodds' weblog I had some luck, but admittedly not a huge amount, finding services on the web that did this directly from the latitude and longitude. Most preferred to work from addresses. Ugh! Out of the nice simple world of numbers and into the messily human matter of addresses.

In order to go from coordinates to city names, you need a list of cities, and a way of calculating which is the nearest one. This is what I've implemented for Dashboard, covering about 7,000 "important" cities (hence the title of this piece, as I needed to figure out "great circle" distances in order to find nearby locations.)

I used a freely available dataset. More detailed data tends to be expensive, and it's not clear how an open source project could use that. Besides, I like the fact it steers you towards a reasonably-sized city, as there is a larger likelihood of finding useful web resources for it.

The result of my labours so far can be seen in the screenshot. I'm browsing Leigh Dodds' weblog. Dashboard has picked up on the ICBM meta tag, and displaying a "Local information" panel with the city and country name, and links to mapping, weather and image services.

Help needed

I'm very sure that much better links can be generated than the ones I've got in right now. With local knowledge and special casing we can probably service each country well. What I've got so far works globally, which was my intention. The beauty of open source, however, is that it's easy to get input from lots of people with local knowledge of different parts of the world. So, patches and ideas are very much welcome!

I'm working on obtaining airport locations, so we should soon be able to display nearest airport. I'd love to know if there was a way of finding out nearby 802.11 wireless nodes, too.

What I'd really love is to be able to put small map thumbnails in there. So if you run a mapping service and want your product to be featured on the desktops of the future, you should get in touch. The same goes for other services such as weather that can lend small inline content elements.

blog comments powered by Disqus


You are reading the weblog of Edd Dumbill, writer, programmer, entrepreneur and free software advocate.
Copyright © 2000-2012 Edd Dumbill