Dec
7th

Google Maps now with KML Support

At times like these, I know that I’m a geek! Today the Google Code Blog just announced that they are now supporting KML files.

“Doug, calm down”, you say!

I can’t! I’m freakin’ out! Where you used to have to programmatically plot points on a map, you can now simply ‘point’ to a KML file and Google Maps will automatically plot it on their map.

“Yea, sure”, you say!

Okay! I’ll prove it to you! In under a minute, I put together this KML file:
http://marketingtechblog.com/location.kml

Here are the contents:

<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://earth.google.com/kml/2.1">
<Document>
<Placemark>
<name>Doug</name>
<description>Did you know they just opened Au Bon Pain right here? Here’s my KML file:
http://marketingtechblog.com/location.kml</description>
<Style>
<IconStyle>
<Icon>
<href>http://marketingtechblog.com/wp-content/uploads/2006/06/me2.thumbnail.jpg</href>
</Icon>
</IconStyle>
</Style>
<Point>
<coordinates>-86.158160,39.767480,0</coordinates>
</Point>
</Placemark>
</Document>
</kml>

Using Google Maps, I simply point the map to query my KML file:
http://maps.google.com/maps?q=http://marketingtechblog.com/location.kml

“Wow”, you finally say! (I hope!)

Here’s what it looks like:
Map of Doug in Indianapolis

Seriously folks. Where XML is the universal data exchange format, KML (which is XML) is the universal geographic data exchange format. This is a great step forward. Using other GIS programs, people can output KML files and then simply open them online with Google Maps.

RSS feed | Trackback URI

11 Comments »

Comment by no imageGraydon (SezWho)
2006-12-07 01:37:39

You make it sound great… just point me in the direction of how to make a kml file and I might just fully agree…
Rate this:
2.9
 
Comment by no imageDouglas Karr (SezWho)
2006-12-07 11:08:45

Hi Graydon,

Good point! I’ll update the post with instructions, open up the KML file that I have posted and you’ll see the structure. The KML file is raw text. There are also KMZ files out there. Those are KML files that are zipped up for faster transfer (if you have a huge file).

Doug

Rate this:
2.9
 
Comment by no imageCJ (SezWho)
2006-12-07 14:50:47

That is SO cool! What will they think of next?
Rate this:
2.9
 
Comment by no imageDouglas Karr (SezWho)
2006-12-07 16:19:35

One note I forgot to mention is that the KML file can also be prepared or opened with Google Earth as well, a free GIS desktop application! You can download the latest beta here:

http://earth.google.com/

Rate this:
2.9
 
Comment by no imageAswin van Braam (SezWho)
2007-03-02 03:29:00

This is really awesome!

Just wondering, why is the KML-file case sensitive. If you create the XML file with tags that have lower case starting letters. The XML/KML doesn’t work. (that’s what happend to me :D)

Rate this:
2.9
Comment by no imageDouglas Karr (SezWho)
2007-03-02 08:37:19

Aswin,

I’ve noticed this as well. It’s the same with the geotag. I have no idea why they would actually impose uppercase letters in a standard. I’ve always thought it was safe for lowercase (rather than upper), but some of these services out there are really finicky.

Thanks!
Doug

Rate this:
2.9
 
 
Comment by no imageAswin van Braam (SezWho)
2007-03-09 10:39:17

I have found a way to get this working.

I’ve found an little freeware program (xt.exe) that works with a XSL file that can transform the not-working XML to a working KML file.

In the XSL file (a stylesheet) provides the base of a working a xml. I can transform the lowercase tags with upper case tags. With a rename action on the working xml-file (xml to kml) you get a working kml file :)

Rate this:
2.9
 
2007-03-17 12:25:38

[...] December, Google Maps added KML support to their API, so you can easily output your layers as a KML file and point to it with a Google [...]
 
Comment by no imageGraydon (SezWho)
2007-05-12 01:38:12

if for some reason you didn’t see it, the new google mymaps thingy lets you build a map and export the kml file.

and since the google api let’s you create a map on your site built from a hosted kml file… well it all becomes easier.

Rate this:
2.9
 
2007-10-15 08:05:41

[...] site’s geographic location along with your other pages. This can be done best by supplying a KML file with your coordinates in an XML format - a format that’s easy to read by programming [...]
 
2008-03-18 19:57:35

[...] Last year I assisted the Indianapolis Cultural Trail by mapping out the incredible cultural bike and walkways that are being constructed in Indianapolis using Google Earth. Part 1 was how to utilize Google Earth to plot your trails and export them to a KML file. [...]
 
Name (required)
E-mail (required - never shown publicly)
URI
Your Comment (smaller size | larger size)
You may use <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> in your comment.

My Comment Policy: I moderate comments. Please be patient:

  • Spam will happily be destroyed.
  • Use your real name, not some keywords. Otherwise it will be destroyed.
  • Mean comments aren't necessary. If I don't post them I will reply personally to let you know why.
  • Lewd comments will be edited, I don't want my readers leaving because of offensive content.
Great debate, criticism and colorful commentary is always appreciated and approved!