What is KML and KMZ files with examples

By webmaster at 15 November, 2010, 7:30 am

KML

KML

In this post we’ll exaplain what is a KML or KMZ file with examples.

Definition of KML

Keyhole Markup Language (KML) is an XML-based language schema for expressing geographic annotation and visualization on existing or future Internet-based, two-dimensional maps and three-dimensional Earth browsers.

KML files are very often distributed in KMZ files, which are zipped files with a .kmz extension.

If you want to make a map with your business locations or for your preffered locations beside google maps when you can point on the map your preffered locations you can also made a KML file where you can put your locations. All you have to know is GPS address location. If you dont know what is a GPS or a GPS locations please standby for 1-2 days and i’ll explain to you what is it.

<?xml version=”1.0″ encoding=”UTF-8″?>
<kml xmlns=”http://www.opengis.net/kml/2.2″ xmlns:atom=”http://www.w3.org/2005/Atom”>
<Document><name>MivGO Places</name>
<atom:author>
<atom:name>Your Name</atom:name>
</atom:author>
<atom:link href=”http://www.mivgo.com/” />
<Placemark id=”1″>
<name>Name of Location</name>
<description><![CDATA[  ]]></description>
<Point>
<coordinates>XXX.XXXXX,YYY.YYYYY</coordinates>
</Point>
</Placemark>
</Document></kml>

1. <name>MivGO Places</name> Name of KML document between You’ll add the name of your document, for example “Angelina’s preffered places”
2. <atom:name>Your Name</atom:name> Your Name can be replaced with your name, of course, if you want and is not mandatory
3. <atom:link href=”http://www.mivgo.com/”> http://www.mivgo.com can be replaced with your website address, http://www.mivgo.com/
4. <Placemark id=”1″> ID of each location you add. If you have more each placemark must have a different id. Example bellow.
5. <name>Name of Location</name> you’ll add the name of each location. Domino’s Pizza, Italian Restaurant etc
6.XXX.XXXXX,YYY.YYYYY ( GPS data, where X = longitude and Y= latitude ). This MUST have as much as you can more precise. Because if the latitude and longitude is wrong on the map your location it will be located in other place on the man than the real position.

Bellow is an example with 2 locations.

<?xml version=”1.0″ encoding=”UTF-8″?>
<kml xmlns=”http://www.opengis.net/kml/2.2″ xmlns:atom=”http://www.w3.org/2005/Atom”>
<Document><name>MivGO Places</name>
<atom:author>
<atom:name>Your Name</atom:name>
</atom:author>
<atom:link href=”http://www.mivgo.com/” />

<Placemark id=”1″>
<name>Casa Tora</name>
<description><![CDATA[  ]]></description>
<Point>
<coordinates>XXX.XXXXX,YYY.YYYYY</coordinates>
</Point>
</Placemark>

<Placemark id=”2″>
<name>Casa Tora</name>
<description><![CDATA[  ]]></description>
<Point>
<coordinates>XXX.XXXXX,YYY.YYYYY</coordinates>
</Point>
</Placemark>

</Document></kml>

If you have question feel free to leave a comment and we’ll answer you.

We will write later about where to use KML and KMZ files after we made them.

Categories : News
Tags: , , , ,


Trackbacks & Pingbacks

Comments
Leave a comment