
A file format that displays geographic data in an Earth browser, such as Google Earth, Google Maps, and Google Maps for mobile, Keyhole Markup Language (KML) was originally named Keyhole Earth Viewer and was developed for use with Google Earth. It’s now an international standard the Open Geospatial Consortium (OGC) maintains. KML was created by Keyhole, Inc., which was acquired by Google in 2004. It became an international standard of the Open Geospatial Consortium in 2008.
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="1www.opengis.net/kml/2.2">
<Placemark>
<name>A Place</name>
<description>This is an example placemark.</description>
<Point>
<coordinates>-122.0822035425683,37.42228990140251,0</coordinates>
</Point>
</Placemark>
</kml> Purpose and Key Features
KML is used to describe and display geographic data, including points, lines, images, polygons, and models, on maps and Earth browsers.
- Placemarks: You can mark locations on the map, add descriptions, and customize the appearance using styles.
- Paths and Polygons: It allows drawing paths (lines) and polygons to show routes or areas on a map.
- Overlaying Images: You can overlay images on geographical locations, which is useful for various mapping and geographical analyses.
- 3D Models: KML supports including 3D models, which can be placed on the map surface.
Usage in Various Applications
KML files can create detailed layers and overlays in Google Earth, offering a rich, interactive mapping experience.
- Web Mapping: KML files are often used on websites to embed custom Google Maps with specific locations, paths, or area markings.
- Geographical Analysis: It’s also used in GIS (Geographic Information Systems) for spatial analysis and visualization of geographic data.
Example of a Simple KML File
This example demonstrates a basic KML file with a single placemark, a common use case for mapping specific locations.
“`xml <?xml version="1.0" encoding="UTF-8"?> <kml xmlns="http://www.opengis.net/kml/2.2"> <Placemark> <name>A Place</name> <description>This is an example placemark.</description> <Point> <coordinates>-122.0822035425683,37.42228990140251,0</coordinates> </Point> </Placemark> </kml>