There’s a nifty feature hidden in Gnome that’s interesting to play with. Click on the date in the upper right. You get an applet with a calendar. Below the calendar is “Locations”, click on that. Nifty little map showing the line where sunset and sunrise are. Click on edit, and you get to add your favorite locations to the map. But not just your favorite timezones, you get to pick from a huge list of geographic places. My hometown, little Roseburg Oregon is in there. African capitals are in there, though sadly Monrovia got missed. And when you add the clocks, you get weather too!
I went searching to see where this geo-database is stored, to see if I could use it for my own nefarious purposes. It is part of gWeather, and is stored in /usr/share/libgweather/Locations.xml (it is a 900 kb XML file, which might give you an idea why Gnome is such a memory pig). According to the handy DTD stored next to it, you can get this kind of data out of it:
- Regions, Countries, State, City, Location
- ISO code
- FIPS code
- Preferred language
Strangely, the coordinates are stored in a non-XML field, a pair of floating point numbers. As a database, the whole thing is a gluttonous pig. But it’s interesting to think that every Ubuntu laptop is carrying a little geo-mapping database with it, isn’t it?