It's unbearably hot, the fan is pushing hot air around, and I've been banging my head against the wall for three hours straight with a margin problem that, of course, only happens in Internet Explorer. Instead of trying to fix that godforsaken mockup or checking the Apache logs, I closed Zend Studio. I opened that little program they released a month and a half ago after buying Keyhole. And here I am, hooked like an idiot.

I have literally spent the whole summer using Google Earth to fly over my neighborhood, look for my grandparents' neighborhood, and zoom in to check the resolution of the football stadium. It's absurdly addictive.

How it renders the whole planet

At an engineering level, what they've built is an absolute beast. You're not downloading a static map in the browser. You're loading a 3D globe that streams satellite imagery based on the camera's coordinates and zoom level.

My poor ADSL suffers every time I drop altitude quickly, but the client has a very aggressive disk caching system. If you look at the settings, it lets you reserve up to 2 GB of hard drive space and about 128 MB of RAM just to store the cells you've already visited.

On my home PC I have a GeForce FX 5200 graphics card, nothing special, but the engine gives you the choice between DirectX and OpenGL. I've set it to OpenGL and it runs surprisingly smooth, at least when Google's servers aren't choking trying to send you the high-resolution texture tiles.

Playing with KML and coordinates

But the fun part isn't doing virtual tourism. What has kept me tinkering all night is how you can interact with the map. It turns out they use an XML-based format called KML (Keyhole Markup Language). You can create your own layers, add points of interest, polygons, or even models if you go crazy.

Just to show you how easy it is, I put together a quick snippet to mark places. You create a plain text file, give it a .kml extension, and Google Earth opens it right up and takes you there:

<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://earth.google.com/kml/2.0">
  <Placemark>
    <name>La Cueva</name>
    <description>Aquí estamos tirando líneas de PHP hasta las tantas.</description>
    <Point>
      <coordinates>39.706901, -31.107265</coordinates>
    </Point>
  </Placemark>
</kml>

Ideas from the trenches

I was thinking about what could be achieved by coding around this. Can you imagine being able to plug in the geolocated logs of your web server visits and seeing where users are coming from on a globe? All you have to do is parse the IPs to coordinates, dump it into an XML generated on the fly from a PHP or Perl script, and serve it with its corresponding MIME type. You could set it up in half an hour.

It still lacks resolution in many areas of Spain—my hometown looks like a blurry smudge of brown and green pixels—but having a Geographic Information System for home use that doesn't require setting up an ArcIMS server is mind-blowing.

Hopefully one day you'll be able to connect these layers via USB with Garmin GPS devices, or the guy from the local bar will be able to upload his location to the map using some API. For now, I'm satisfied just being able to see the cars parked on my street, and trying not to melt my hard drive with the local cache.