← All help articles
FAQ11 nov 20263 min read

What is a KML file?

KML, or Keyhole Markup Language, is an XML-based file format commonly used for displaying geographic data in mapping applications. Developed by Keyhole, Inc., which was later...

By Spotzi

KML, or Keyhole Markup Language, is an XML-based file format commonly used for displaying geographic data in mapping applications. Developed by Keyhole, Inc., which was later acquired by Google, KML is an open standard maintained by the Open Geospatial Consortium (OGC). It is widely used for visualizing spatial information in tools like Google Earth, Google Maps, and other Geographic Information System (GIS) software.

KML files can contain various elements to represent geographic features such as points, lines, and polygons, as well as attributes like names, descriptions, and styles. This makes KML a versatile format for creating interactive and dynamic maps. Users can create custom maps by defining placemarks, paths, and overlays, and they can also incorporate additional data layers for more detailed and informative visualizations.

KML files are human-readable, as they are written in XML, and they can include elements for describing 3D structures, photo overlays, and time-based data. This flexibility makes KML a valuable tool for a range of applications, from simple map annotations to complex geospatial presentations.

KML Structure Explained

KML (Keyhole Markup Language) data is structured using XML (eXtensible Markup Language), which is a widely used markup language for encoding data in a format that is both human-readable and machine-readable. Here is a brief overview of the key components and structure of KML data:

  • Document Structure: A KML document starts with an opening <kml> tag and includes a <Document> element. The document can contain various elements such as <Placemark>, <Folder>, <Style>, <NetworkLink>, and others.
  • Placemark: The <Placemark> element is used to define a point, line, or polygon on the map. It typically contains a element for the feature's name and a <description> element for additional information. The geometry of the feature is defined within the <Point>, <LineString>, or <Polygon> elements.
  • Point, LineString, and Polygon: <Point> is used for defining a single point on the map. <LineString> is used for defining a series of connected line segments. <Polygon> is used for defining an area enclosed by a set of boundary coordinates.
  • Style: The <Style> element is used to define the appearance of geographic features. It can include attributes such as color, line width, and icon styles. Styles can be applied to individual features or shared among multiple features.
  • Folder: The <Folder> element is used to organize and group related features within a KML document. It contains other KML elements, such as <Placemark>, <Style>, and <Folder>, allowing for hierarchical structuring of data.
  • NetworkLink: The <NetworkLink> element enables the dynamic retrieval of KML content from a network link, allowing for live updates of geographic data.
  • Extended Data: The <ExtendedData> element allows for associating custom data fields with a feature. This can include information such as timestamps, numeric values, or additional descriptive text.

KML File Example

KML File Example
KML File Example

Which software opens GML files?

  • Spotzi
  • Google Maps
  • QGIS
  • Arcgis
  • Mapinfo

Associated filename extensions

  • .xml
  • .kml
  • .gml

Spotzi in numbers

700M+

people in motion daily

5,000+

audiences

Millions

points of interest