KML, formerly known as Key Hole Markup Language, is an XML language for expressing geographic annotation and visualization for two-dimensional and three-dimensional representations of the Earth. Examples of what can be done in KML are represented bellow.


KML 2.2 was submitted by Google to be adopted as an OGC standard in 2008.


2.2 is the current latest version

Test Suite

A test suite exist in the OGC repository.


KML is used for:

  • Annotate Earth features

  • Specify icons and labels to identify locations on the surface of the planet

  • Create different camera positions to define unique views for KML features

  • Define image overlays to attach to the ground or screen

  • Define styles to specify KML feature appearance

  • Write HTML descriptions of KML features, including hyperlinks and embedded images

  • Organize KML features into hierarchies

  • Locate and update retrieved KML documents from local or remote network locations

  • Define the location and orientation of textured 3D objects

Relation to other OGC Standards

KML is an encoding. Services such as Web Map Service (WMS) and Web Feature Service (WFS) can publish images and features as KML. The reason is that KML is a combination of visualization and data encoding. As seen in the example bellow coordinates and styles are defined in one file.


A KML instance is encoded in XML as shown in this example:

<kml xmlns="">
       <name>Document.kml</name> <open>1</open>
       <Style id="exampleStyleDocument">

           <name>Document Feature 1</name>

           <name>Document Feature 2</name>


  • The root element is kml

  • Then a Document element is declared

  • A Document contains Placemarks that provide the details of the features. It can contains various elements such as:
    • name

    • styleURL

    • Point