Introduction
KML is the format of Google Earth: places, paths and areas to show on a map or globe, with names, descriptions, icons and colours. It was created by Keyhole, the company whose viewer became Google Earth, and became an Open Geospatial Consortium standard, KML 2.2, in 2008. Google My Maps and many GPS and mapping tools import and export it.
A .kmz file is a ZIP archive holding a
KML file, usually named doc.kml, together with the images and other files
it uses.
Structure
KML is XML. The root element is
<kml> in the namespace http://www.opengis.net/kml/2.2,
usually holding one <Document>. Inside it, <Folder>
elements group <Placemark> elements, and each placemark has a name,
a description and a geometry: <Point>,
<LineString>, <Polygon> or
<MultiGeometry>.
Coordinates are written in a <coordinates> element as
longitude,latitude,altitude triples separated by spaces, in WGS 84.
<Style> elements set icons, line colours and fills, and
<GroundOverlay> drapes an image over the ground. The
elements page lists the elements of
KML 2.2 and every enumeration.
Not described
Re-checked on 2026-11-13 against ogckml22.xsd; its elements, value types, enumerations and defaults are on the
elements page. The text of OGC 07-147r2, which the schema accompanies, was not read.
Known, not yet covered
- Reference: the prose rules of the standard that the schema cannot express: how overlays, regions, level of detail and network links behave, the semantics of each element and the constraints between them (for example that a LinearRing is closed). The page states a few from general knowledge of the standard; the standard itself is not yet cited for them.
- Reference: Google’s
gx:extensions (gx:Track,gx:LatLonQuad,gx:altitudeModeand others), which are a separate schema, and the Atom and xAL schemas that KML imports.
Links
Software
- Google Earth Pro – Google’s globe, which opens and saves KML and KMZ, as does Google Earth on the web (Windows, macOS, Linux)
- Google My Maps – Google’s custom map maker, which imports and exports KML (web)
- QGIS – free GIS that loads KML as map layers (Windows, macOS, Linux)
- GDAL – with its
ogr2ogrtool, converts KML to and from other map formats (Windows, macOS, Linux)
Developers
Reference
- OGC KML – the Open Geospatial Consortium standard
- KML Reference – Google’s reference for every element