KML – a little goes a long way!

A little KML goes a long way

At the end of my last post I signed off saying "What’s next for me? … KML." In my mind I pictured learning KML to be like learning HTML, i.e. quite a project. To my happy surprise though, KML is easy. It’s a friendly little critter!

Here’s what transpired. I was thinking about this new route up this mountain, then suddenly I thought "Why don’t I give it just ten minutes and see what happens? Who knows, maybe I’ll get lucky." Well big surprise, in ten minutes I was done! I drew the route on my big computer Joe, moved it onto my little tablet Flaco, and got it to open in all three of my Android map apps. It being the weekend, we packed along the little path with our candy bars etc, and took the hike. That’s all there was to it. Hiking on the real mountain the route was anything but obvious, but following the little pre-made path and the blue dot, we stayed on track easily.

KML stands for Keyhole Markup Language. Keyhole was originally the company Google bought in 2004 so that they could own the knowhow which quickly became Google Earth and Google Maps. Like HTML, KML is just text. It gets interpreted and displayed by a browser – in this case a KML browser like Google Earth. If you’ve never peeked inside a KML file, here’s one, I gave it a TXT extension – BellDirect.txt. If you click on it you can see what the source of a typical KML looks like. This file is less than 4 kB, tiny. Between the </coordinates> tags is the heart of it, just a long list of points on the map:

Coordinates Text

The browser knows how to string these together into a path. So if you click on the exact same file with its regular file extension here – BellDirect.kml – you should see the path open, all pretty like, in Google Earth.

But it turns out you don’t need to know any of that underlying source to make your own KML’s. Google Earth and Google Maps not only read KML, but also write it, and even edit it. Drawing simple paths and such, then moving them around between devices and applications, is really easy to learn. Google provides great howto’s for both Earth and Maps. So it’s very easy to create little KML’s, then use them any way you want in the field. Any mapping application can import and display a KML.

I’ll leave it to the reader to learn the idiosyncrasies of saving, importing, and exporting KML’s between apps. But once this becomes second nature – quick – it will open up a new world for you if you depend on maps. There’s no limit, of course, to how far you can take this. You’ll find a deep set of advanced features, if you want to go there. But the point of this post is only to say that if you feel like making little KML’s of your own, just do it. After only ten minutes of fussing you’ll have something truly useful in real life. After another ten minutes, it will already be second nature.

 - Pete

No comments yet. Be the first.

Leave a reply