Keyhole Markup Language (KML)
KML is an XML-based format for encoding geographic data and map visualizations. Used in virtual globes and mapping platforms, it supports placemarks, overlays, 3D models, styles, and compressed .kmz packages.
Overview
Keyhole Markup Language (KML) is a text-based format used to represent geographic features and visual styling for display on maps and virtual globes. Like how a web browser renders pages written in HTML, KML provides a standardized way to describe locations, geometries, and how they should appear when shown in a mapping viewer.
Structure and main elements
KML files are organized using XML syntax and commonly use the .kml extension; collections of related files and assets are often packaged into compressed .kmz archives. Typical elements include:
- Placemark — a point, line or polygon with a name and description.
- Style — visual rules for icons, lines and polygons, including color and scale.
- GroundOverlay and ScreenOverlay — images placed on the map or the screen.
- Model — 3D objects referenced by Collada files for three-dimensional visualization.
- NetworkLink — references to remote KML that can be updated dynamically.
Technical characteristics
KML relies on geographic coordinates based on widely used datum systems and supports altitude, complex geometries, and time-based elements for animated tours. Because it is XML, KML files are human-readable and editable with text tools, and many GIS and mapping applications can import and export KML/KMZ. Styling and hierarchical folders help organize large datasets for presentation.
History and standardization
Originally developed for a commercial mapping product, KML later became closely associated with mapping services from major providers. After its introduction and broad adoption, the specification was submitted to a geospatial standards body and accepted as an international standard. Documentation and examples were published by the company that maintained the format, including guidance for authoring and best practices — see resources from Google.
Uses and examples
KML is used for sharing tour routes, field survey results, public map layers, and 3D building models. It is especially useful when the visual appearance and presentation of a dataset matter as much as the raw coordinates. KML content is commonly viewed in online and desktop platforms such as Google Maps and in virtual globe applications like Google Earth, and can be imported into GIS tools for analysis or republished for mobile and web consumption.
Distinctions and notable facts
Compared with lightweight exchange formats used for geographic data (for example, GeoJSON), KML emphasizes presentation and visualization, including advanced styling and 3D support. It also offers mechanisms for linking to live content and packaging resources in a single KMZ file. Because KML can execute remote links and include rich HTML descriptions, users and organizations should be mindful of performance and security when publishing or loading KML from untrusted sources.
Related articles
Author
AlegsaOnline.com Keyhole Markup Language (KML) Leandro Alegsa
URL: https://en.alegsaonline.com/art/53132