Friday, May 04, 2007

Hintsandtips: Using a basic KML template

I use a really basic KML template to wrap KML based results for use with Google Earth. Just replace the Name and Description fields with text, and the Results field with co-ordinates (in "lon,lat,alt" format).

<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://earth.google.com/kml/2.0">
    <placemark>
        <name>Name</name>
        <description>Description</description>
        <style>
            <linestyle>
                <width>4</width>
            </linestyle>
        </style>
        <linestring>
            <tessellate>1</tessellate>
            <altitudemode>clampToGround</altitudemode>
            <coordinates>
                Results
            </coordinates>
        </linestring>
    </placemark>
</kml>

To convert the .kml file into a .kmz file, just ZIP it, e.g. 'zip -9 -m file.kmz file.kml'.

No comments: