KML File Documentation


Overview

Feature Value
File Extension .kml
MIME Type application/vnd.google-earth.kml+xml
Developed by Keyhole, Inc., Google
Primary usage Geospatial data representation
Based on XML
Structure Hierarchical
Support for 3D Models Yes, via Collada integration
Open format Yes
Primary Elements Placemark, Document, Folder, NetworkLink, Overlay, Style
Geospatial elements Point, LineString, LinearRing, Polygon, MultiGeometry
Overlay support GroundOverlay, PhotoOverlay, ScreenOverlay
Coordinates format Longitude, Latitude, [Altitude]
Altitude mode options clampToGround, relativeToGround, absolute
Animation support Yes, via GX extensions for tours
Style customization IconStyle, LabelStyle, LineStyle, PolyStyle, BalloonStyle
Namespace declaration xmlns:kml="http://www.opengis.net/kml/2.2"
Availability Free and open
File size Generally small, but depends on content
Compatibility Widely supported by GIS software and mapping applications
Encoding UTF-8

What is a KML File?

Keyhole Markup Language (KML) is a file format used to display geographic data in an Earth browser such as Google Earth, Google Maps, and Google Maps for mobile. KML files specify a set of features (place marks, images, polygons, 3D models, textual descriptions, etc.) for display in Google Earth, Maps, and other geospatial software. This format is widely used for sharing geographic data and creating rich, interactive maps.

The History and Evolution of KML

The KML file format was originally developed for use with Keyhole Earth Viewer, which eventually became Google Earth after it was acquired by Google in 2004. The development of KML was driven by the need to enable users to share large and complex geographic datasets in an easily accessible manner. Over the years, KML has evolved to support a wide range of features, including 3D models, custom icons, and complex polygon shapes.

With the release of KML 2.2 in April 2008, the format was officially standardized by the Open Geospatial Consortium (OGC), ensuring its compatibility and interoperability across different geographic information systems (GIS). This standardization marked a significant milestone in KML's evolution, confirming its status as a key format for geospatial data exchange.

Since then, KML has continued to evolve, incorporating new features and functionalities to meet the growing demands of users and developers. Its ease of use, flexibility, and compatibility with numerous applications have led to its widespread adoption in various fields such as environmental monitoring, urban planning, and disaster response coordination.

KML File Structure

Basic Syntax of KML

The Keyhole Markup Language (KML) is structured similarly to XML, with tags and attributes used to define the properties of geographical data. A KML file starts with the tag, followed by a or tag that encapsulates the data. Inside these, a hierarchy of elements defines everything from simple placemarks to complex overlays and models. Common tags include:

  • - Defines a specific location, shape, or feature on the map.
  • - Specifies a point location by its latitude and longitude.
  • - Defines a series of connected line segments.
  • - Outlines a closed area on the map.