Comparing Geographical Sizes

A long time ago I thought it would be fun to open two windows and see two things on Google Maps next to each other. That way, I could compare the sizes of them. But getting the scale set the same on both maps was not easy. Wouldn’t it be neat if the scale of the maps was set to the same?

I finally got around to implementing this with Google Maps API:

To test it out, type “Liberia” in the left one. Then type “Switzerland” into the right one. Zoom one in and out and notice how the other one changes. You can also see the page alone in it’s own page.

As usual with Google maps apps, view source (in the iframe) to see how it’s done. The tricky bit is removing and adding the event handlers so that you do not create a notification loop. The auto-sizing code is nifty too, if I do say so myself.

Update: My good buddy Andrew pointed out that this has already been done.

Locations Database in Gnome

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
  • Timezones
  • ISO code
  • FIPS code
  • Preferred language
  • Radar
  • Coordinates

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?