A KML file stores geo-modeling data in XML format. It contains dots, lines and images. Use XML to express geographic annotation and visualization by storing locations, overlaying images, video links, and modeling information such as lines, shapes, 3D images, and points. Various geospatial software solutions use the KML format to place data in a format that other programs and web services can easily use.
Introduction
Keyhole Markup Language - An XML designation for expressing geographical annotation and visualization in two-dimensional maps and three-dimensional browsers. KML was developed for use with Google Earth, which was originally called Keyhole Earth Viewer. It was created by Keyhole. Inc, which was acquired by Google in 2004. This format became the international Open Geospatial Consortium standard in 2008.
Google Earth was the first program to view and graphically edit such files. Other projects, such as Marble, also began to develop support for KML.
Application: how to create a KML format?
You can open a file with this extension in Google Maps. To do this, you need to place its location online, and then enter the URL in the Google Maps search box.
Google Earth was the first program that could view and edit these files, and it still remains one of the most popular ways to work with geodata on the Internet. Once youβve opened a web page, use the My Places menu item (bookmark icon) to download the KML file from your computer or Google Drive account.
You can also open files using any text editor (e.g. Notepad ++). This will allow you to see the text version, which includes coordinates, image links, camera angles and time stamps.
If you want to convert KML to XML, you do not need to do the conversion. Since the format is actually XML (the file just uses the KML extension), you can rename .KML to .XML so that it is open in your XML viewer.
You can also import the file directly into Google Maps. This is done on the Google My Maps page when adding content to a new map layer. With the map open, select βImportβ at any level to download the file from your computer or Google Drive. You can create a new layer using the "Add Layer" button.
You can also create your own KML file and its URL on Google Maps by pre-linking the URL of your file using http://maps.google.com/maps?q=. For example, to open the same address, you can use the following URL: http://maps.google.com/maps?q=http://mywebsite.com/myfile.kml.
This operation also works for Google Earth, a three-dimensional plug-in for viewing our planet, which can be added to a web browser.
Structure
The KML file format indicates a set of functions (labels, images, polygons, 3D models, text descriptions) for display on Google Maps, Google Earth, Maps, mobile devices or any other geospatial software that implements KML encoding. Each location has longitude and latitude. This format shares some of the same structural grammars as GML. Some information cannot be viewed on Google Maps or on mobile devices.
Data is very often distributed in the KMZ format, which are encrypted KML files with the extension .kmz. They must be compatible with legacy (ZIP 2.0) compression, otherwise the .kmz file may not be decompressed.
Geodetic reference systems in KML
For its frame of reference, KML uses 3D geographic coordinates: longitude, latitude and altitude. Longitudes, latitudinal components (decimal degrees) are determined in accordance with the 1984 World Geodetic System (WGS84). The vertical component (height) is measured in meters from the vertical base of the geoid WGS84 EGM96 Geoid. If the height is not specified in the coordinate line (for example, -77.03647, 38.89763), then the default value for the height component is assumed to be 0 (approximately sea level), i.e. (-77.03647, 38.89763, 0).
The formal coordinate system definition (encoded as GML) used in KML is contained in the OGC KML 2.2 specification. This definition refers to EPSG CRS components.
Documentation
The KML 2.2 specification was presented in an open geospatial consortium to ensure its open standard status for all geo objects. In November 2007, a new working group was created within the OGC to formalize the standard. Comments on the proposed standard were requested before January 4, 2008, and it became the official OGC standard on April 14, 2008.
The Standards Working Group finalized the change requests for KML 2.2 and incorporated the accepted changes. The official OGC KML 2.3 standard was published on August 4, 2015.