Monday, February 04, 2008

KML for Web Mapping

Keyhole Markup Language (KML) is starting to become a de facto standard for transmitting spatial data. Both Google Maps and Microsoft's Virtual Earth have added support for viewing KML data. In both of these cases, it is necessary to make the KML file available on the web so that Google and/or Microsoft can access the file and process it to be viewed in their map controls.

Google Map's, as you might imagine, is getting much better at displaying KML on their web map. The example below shows a KML file (created by Shape2Earth) showing the total number of households by state.

First in Google Map:

http://maps.google.com/maps?q=http://shape2earth.com/Documents/states_NumHouseholds.kml

Then in Virtual Earth.

http://maps.live.com/?mapurl=http://shape2earth.com/Documents/states_NumHouseholds.kml

Note how the geometries in Virtual Earth do not line up very well, and in some cases, are not visible at all. Virtual Earth also seems to automatically add a center point, and does not adhere to the KML coloring scheme. If you switch to 3D mode, the geometries will line up much better, but the fill color seems to be absent.

It looks like any investments that you might be making in KML converters are going to be beneficial for some time to come.