Visualize Spatial Data With KML

Visualize Spatial Data With KML
Visualize Spatial Data With KML

KML files used to visualize spatial data by storing locations, image overlays and modelling information like lines, shapes. 3D images and points in an Earth browser such as Google Earth. In addition, a KML file can also be displayed in Google Map. KML file used tag-based structure and is based on XML standards. Various geospatial software package uses KML files since the aim is to place the information into a format that other software package and web services will simply use. KML was first created in 2001 by a company called Keyhole Inc., which acquired later on by Google in 2004 and started using the format with Google Earth.

Must Read: Fly to your desired location on Earth Using Google Earth

KML is in a position to display various geospatial data format, like vector, raster including non-geospatial data formats like 3D and even animation.  As a result of the rich abilities, the KML widely used for various applications.

KML File Structure

A KML begins with an XML open tag. Then followed with KML tag that includes KML version. Once the initiation, it’s followed by content syntax. At the end of the section, like other XML formatting language must be closed by a paired tag, in this case, the KML file must be closed with </kml>.

As an example, KML file structure is shown below.

<?xml version=”1.0” encoding=”UTF-8”?>

<kml xmlns=””>

kml document content . . . .


KML is case sensitive, meaning that differences in uppercase and lowercase letters must be considered.


The default file for spatial data in Google Earth is a .KML file. KML files are very often distributed in KMZ files. Both KML and KMZ file extensions are used in Google applications, specifically Google Earth and Google Maps.

But what is .KMZ file?

KML file contains a lot of graphics, features and other related content that can include placemarks, images, polygons, 3D models, textual descriptions, and others. After being created and saved, a KML file can be compressed – the compressed file is called a KMZ file with a .kmz extension. Since most of the images are larger in file size and can take a lot of disk space, a .KMZ file has all the information is a single unit with a lot of difference in size and more ease in data transfer.

Illustration of KMZ file
Illustration of KMZ file


  1. “KML” stands for “Keyhole Markup Language,” which is default file extension for Google Earth application while “KMZ” stands for “Keyhole Markup Language Zipped.”
  2. KML is the file extension for an unzipped file, while KMZ is the zipped version of a KML file which stores the content in a single unit.
  3. KML has a larger file space and longer data transfer compared to KMZ file extension.

Reference systems in KML

KML uses 3D geographic coordinate’s reference system i.e. longitude, latitude, and altitude. The longitude and latitude components are as defined by the World Geodetic System of 1984 (WGS84). The altitude is measured in meters from the WGS84 EGM96 Geoid vertical datum. If altitude is not mentioned then the default value 0 is assumed. A formal coordinate reference system is defined in the OGC KML 2.2 Specification.

Visualize Spatial Data in KML format?

KML is an excellent file format to Visualize Spatial Data and content with a wide audience because:

  • It is a portable file that can contain all information such as features, imagery, symbology, descriptions, attributes, and other related content.
  • It can be read and recognized by a number of free and popular geo-based program or application.

Other Types of Data That Are Compatible with Google Earth

In addition to visualize spatial data as KML files, Google Earth allows users to import different types of data, listed below are the details:

GPS data:Google Earth supports most of the GPS devices. While importing GPS data into Google Earth, it gets categorized into three possible folders:

  • Tracks (or trackpoints)—GPS devices automatically recorded points periodically along a recorded route. These Tracks can be imported into Google Earth as paths.
  • Waypoints—points entered manually by the user while using the GPS Devices and these points typically marked with a name, such as “Home” or “Work.”
  • Routes—these are the points that the GPS device uses to create the routing, such as when the user searches in the device to “go to” a recorded point from another recorded point. These Routes can be imported into Google Earth as paths.

Imagery:User can also import imagery into Google Earth Application, there are two ways to import imagery into Google Earth listed below:

  • Photos— User can add their photos to Google Earth that they have taken on their Tour. Photos from your Phone, Computer or the Internet can be placed in a geographic location and other users can navigate to this location.
  • Image overlays—Image overlays can be shown over the surface of the earth. User can use satellite image, topographical maps, or other geographical image data that is available on internet or from other sources can be used as image overlays. These Overlay images must be North orientation with simple cylindrical projection. Image overlay files may be hosted online or stored locally on your hard drive. When adding an image overlay from an online image, user should have the image’s URL, and it must end in .JPG or another image file extension supported by Google Earth. Image overlay conforms to the terrain of the land available in Google Earth Application as a Layer. User must turned on the terrain layer.

More Information on the KML Format

From the year 2008, KML has been part of an international standard of the Open Geospatial Consortium, Inc. KML is used to visualize spatial data using Google Map or Google Earth and any other geo browser-based application or program. To learn more about KML specification, it can be seen on Google’s KML Reference Page.

Reference Link for KML Specification:


Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.