Keyhole Markup Language
Encyclopedia
Keyhole Markup Language (KML) is an XML
notation for expressing geographic annotation and visualization within Internet
-based, two-dimensional maps and three-dimensional Earth
browsers. KML was developed for use with Google Earth
, which was originally named Keyhole Earth Viewer. It was created by Keyhole, Inc
, which was acquired by Google
in 2004. KML is an international standard of the Open Geospatial Consortium
. Google Earth was the first program able to view and graphically edit KML files. Other projects such as Marble
have also started to develop KML support.
and a latitude
. Other data can make the view more specific, such as tilt, heading, altitude, which together define a "camera view". KML shares some of the same structural grammar as GML
. Some KML information cannot be viewed in Google Maps or Mobile.
KML files are very often distributed in KMZ files, which are zipped
files with a .kmz extension. These must be legacy (ZIP 2.0) compression compatible (i.e. stored or deflate
method), otherwise the .kmz file might not uncompress in all geobrowsers. The contents of a KMZ file are a single root KML document (notionally "doc.kml") and optionally any overlays, images, icons, and COLLADA
3D models referenced in the KML including network-linked KML files. The root KML document is typically a file named "doc.kml" at the root directory level but the first .kml file entry in the KMZ file is the actual one selected in Google Earth regardless of its name. By convention the root KML document is at root level and referenced files are in subdirectories (e.g. images for overlay images).
An example KML document is:
The MIME type associated with KML is application/vnd.google-earth.kml+xml; the MIME type associated with KMZ is application/vnd.google-earth.kmz.
. The vertical component (altitude) is measured from the WGS84 EGM96 Geoid vertical datum
. If altitude is omitted from a coordinate string, e.g. (-122.917, 49.2623) then the default value of 0 (approximately sea level) is assumed for the altitude component, i.e. (-122.917, 49.2623, 0) is assumed. A formal definition of the coordinate reference system (encoded as GML
) used by KML is contained in the OGC KML 2.2 Specification. This definition references well-known EPSG
CRS
components.
to assure its status as an open standard for all geobrowsers. In November 2007 a new KML 2.2 Standards Working Group was established within OGC to formalize KML 2.2 as an OGC standard. Comments were sought on the proposed standard until January 4, 2008, and it became an official OGC standard on April 14, 2008.
XML
Extensible Markup Language is a set of rules for encoding documents in machine-readable form. It is defined in the XML 1.0 Specification produced by the W3C, and several other related specifications, all gratis open standards....
notation for expressing geographic annotation and visualization within Internet
Internet
The Internet is a global system of interconnected computer networks that use the standard Internet protocol suite to serve billions of users worldwide...
-based, two-dimensional maps and three-dimensional Earth
Earth
Earth is the third planet from the Sun, and the densest and fifth-largest of the eight planets in the Solar System. It is also the largest of the Solar System's four terrestrial planets...
browsers. KML was developed for use with Google Earth
Google Earth
Google Earth is a virtual globe, map and geographical information program that was originally called EarthViewer 3D, and was created by Keyhole, Inc, a Central Intelligence Agency funded company acquired by Google in 2004 . It maps the Earth by the superimposition of images obtained from satellite...
, which was originally named Keyhole Earth Viewer. It was created by Keyhole, Inc
Keyhole, Inc
Keyhole, Inc., founded in 2001, was a pioneering software development company specializing in geospatial data visualization applications and was acquired by Google in 2004...
, which was acquired by Google
Google
Google Inc. is an American multinational public corporation invested in Internet search, cloud computing, and advertising technologies. Google hosts and develops a number of Internet-based services and products, and generates profit primarily from advertising through its AdWords program...
in 2004. KML is an international standard of the Open Geospatial Consortium
Open Geospatial Consortium
The Open Geospatial Consortium , an international voluntary consensus standards organization, originated in 1994. In the OGC, more than 400 commercial, governmental, nonprofit and research organizations worldwide collaborate in a consensus process encouraging development and implementation of open...
. Google Earth was the first program able to view and graphically edit KML files. Other projects such as Marble
Marble (KDE)
Marble is a virtual globe that allows the user to choose among the Earth, the Moon, Venus, Mars and other planets. It is free software under the terms of the GNU LGPL, developed by KDE and the free-software / open-source communities for use on personal computers running a Qt4-compatible operating...
have also started to develop KML support.
Structure
The KML file specifies a set of features (place marks, images, polygons, 3D models, textual descriptions, etc.) for display in Google Earth, Maps and Mobile, or any other 3D Earth browser (geobrowser) implementing the KML encoding. Each place always has a longitudeLongitude
Longitude is a geographic coordinate that specifies the east-west position of a point on the Earth's surface. It is an angular measurement, usually expressed in degrees, minutes and seconds, and denoted by the Greek letter lambda ....
and a latitude
Latitude
In geography, the latitude of a location on the Earth is the angular distance of that location south or north of the Equator. The latitude is an angle, and is usually measured in degrees . The equator has a latitude of 0°, the North pole has a latitude of 90° north , and the South pole has a...
. Other data can make the view more specific, such as tilt, heading, altitude, which together define a "camera view". KML shares some of the same structural grammar as GML
Geography Markup Language
The Geography Markup Language is the XML grammar defined by the Open Geospatial Consortium to express geographical features. GML serves as a modeling language for geographic systems as well as an open interchange format for geographic transactions on the Internet...
. Some KML information cannot be viewed in Google Maps or Mobile.
KML files are very often distributed in KMZ files, which are zipped
ZIP (file format)
Zip is a file format used for data compression and archiving. A zip file contains one or more files that have been compressed, to reduce file size, or stored as is...
files with a .kmz extension. These must be legacy (ZIP 2.0) compression compatible (i.e. stored or deflate
DEFLATE
Deflate is a lossless data compression algorithm that uses a combination of the LZ77 algorithm and Huffman coding. It was originally defined by Phil Katz for version 2 of his PKZIP archiving tool and was later specified in RFC 1951....
method), otherwise the .kmz file might not uncompress in all geobrowsers. The contents of a KMZ file are a single root KML document (notionally "doc.kml") and optionally any overlays, images, icons, and COLLADA
COLLADA
COLLADA is a COLLAborative Design Activity for establishing an interchange file format for interactive 3D applications. COLLADA is managed by the nonprofit technology consortium, the Khronos Group....
3D models referenced in the KML including network-linked KML files. The root KML document is typically a file named "doc.kml" at the root directory level but the first .kml file entry in the KMZ file is the actual one selected in Google Earth regardless of its name. By convention the root KML document is at root level and referenced files are in subdirectories (e.g. images for overlay images).
An example KML document is:
The MIME type associated with KML is application/vnd.google-earth.kml+xml; the MIME type associated with KMZ is application/vnd.google-earth.kmz.
Geodetic reference systems in KML
For its reference system, KML uses 3D geographic coordinates: longitude, latitude and altitude, in that order, with negative values for west and south. The longitude, latitude components are as defined by the World Geodetic System of 1984 (WGS84)World Geodetic System
The World Geodetic System is a standard for use in cartography, geodesy, and navigation. It comprises a standard coordinate frame for the Earth, a standard spheroidal reference surface for raw altitude data, and a gravitational equipotential surface that defines the nominal sea level.The latest...
. The vertical component (altitude) is measured from the WGS84 EGM96 Geoid vertical datum
EGM96
EGM96 is a geopotential model of the Earth consisting of spherical harmonic coefficients complete to degree and order 360...
. If altitude is omitted from a coordinate string, e.g. (-122.917, 49.2623) then the default value of 0 (approximately sea level) is assumed for the altitude component, i.e. (-122.917, 49.2623, 0) is assumed. A formal definition of the coordinate reference system (encoded as GML
Geography Markup Language
The Geography Markup Language is the XML grammar defined by the Open Geospatial Consortium to express geographical features. GML serves as a modeling language for geographic systems as well as an open interchange format for geographic transactions on the Internet...
) used by KML is contained in the OGC KML 2.2 Specification. This definition references well-known EPSG
European Petroleum Survey Group
The International Association of Oil & Gas Producers is a global forum in which members identify and share best practices to achieve improvements in health, safety, the environment, security, social responsibility, engineering and operations...
CRS
Geographic coordinate system
A geographic coordinate system is a coordinate system that enables every location on the Earth to be specified by a set of numbers. The coordinates are often chosen such that one of the numbers represent vertical position, and two or three of the numbers represent horizontal position...
components.
OGC standard process
The KML 2.2 specification was submitted to the Open Geospatial ConsortiumOpen Geospatial Consortium
The Open Geospatial Consortium , an international voluntary consensus standards organization, originated in 1994. In the OGC, more than 400 commercial, governmental, nonprofit and research organizations worldwide collaborate in a consensus process encouraging development and implementation of open...
to assure its status as an open standard for all geobrowsers. In November 2007 a new KML 2.2 Standards Working Group was established within OGC to formalize KML 2.2 as an OGC standard. Comments were sought on the proposed standard until January 4, 2008, and it became an official OGC standard on April 14, 2008.
See also
- CityGMLCityGMLCityGML is a common information model for the representation of sets of 3D urban objects. It defines the classes and relations for the most relevant topographic objects in cities and regional models with respect to their geometrical, topological, semantical and appearance properties...
- COLLADACOLLADACOLLADA is a COLLAborative Design Activity for establishing an interchange file format for interactive 3D applications. COLLADA is managed by the nonprofit technology consortium, the Khronos Group....
- Geography Markup LanguageGeography Markup LanguageThe Geography Markup Language is the XML grammar defined by the Open Geospatial Consortium to express geographical features. GML serves as a modeling language for geographic systems as well as an open interchange format for geographic transactions on the Internet...
- Geospatial Content Management SystemGeospatial Content Management SystemA Geospatial Content Management System is a Content Management System where objects can have a Latitude, Longitude position to be displayed on an online interactive map...
- GPS eXchange Format
- Point of InterestPoint of interestA point of interest, or POI, is a specific point location that someone may find useful or interesting. An example is a point on the Earth representing the location of the Space Needle, or a point on Mars representing the location of the mountain, Olympus Mons.The term is widely used in...
- WaypointWaypointA waypoint is a reference point in physical space used for purposes of navigation.-Concept:Waypoints are sets of coordinates that identify a point in physical space. Coordinates used can vary depending on the application. For terrestrial navigation these coordinates can include longitude and...