Tutorial: Getting Started with KML

Liz Sanderson
Liz Sanderson
  • Updated

Introduction

KML stands for Keyhole Markup Language. It is an XML-based format (or language if you prefer) intended to store data for use within Google Earth and Google Maps applications.

KMZ is an alternative format to KML datasets. A KMZ dataset is simply a KML dataset compressed by a ZIP-type program and renamed with a new file extension.

KML and FME

Feature Types and Datasets

KML is a file-based dataset, meaning that each KML file is counted as an FME dataset. Each file can contain "Folder id" section representing FME feature types.

For example, if the KML dataset name is planning and the feature type name is ROADS, the output would be a KML file called planning.kml containing a section beginning:

<Folder id="kml_ft_ROADS">

KML and Coordinate Systems

KML stores coordinates as latitude and longitude values based on the WGS84 datum. This is the only coordinate system that KML supports. The FME equivalent coordinate systems are LL84 and EPSG:4326

Data sent to the KML writer must be tagged with a coordinate system, either by specifying it within the source data or using the CoordinateSystemSetter transformer. Then FME will automatically convert the data to LL84. When the data is untagged, and FME is unable to detect the source coordinate system, the translation will be terminated with an error.

KML Basics

Reading KML | KML to MapInfo TAB

Read and translate KML data, in this basic KML to MapInfo TAB translation.

Writing KML with Basic Styling

With the KMLStyler, perform basic styling of polygons and points. Basic KML properties are also set in this MapInfo TAB to KML translation.

Setting KML Regions and Display Criteria

This basic MapInfo TAB to KML translation involves renaming attributes and setting KML properties, including display criteria. The output, viewed in Google Earth, displays KML styling and basic balloons.

Basic 3D KML

Create basic 3D KML by adding Z values to features and setting KML geometry properties, in this Geodatabase to KML translation.

KML Style Range & Display Order

Style KML using attributes, including unique styles by feature, and set the display order of features. The styling in this example includes classifying features into color ranges and extruding 3D features.

Updating KML Balloon Contents & Removing "Directions"

This example demonstrates how to remove "Directions" from KML Balloons, as well as use HTML to set the KML balloon content, in this case, URL links and images, such as pngs, jpegs, and tiffs.

Raster Handling in KML

FME can write georeferenced raster features directly to a KML (or KMZ) dataset. FME is also able to write a combination of vector and raster features to the same output file. 

KML Time Functions

To allow temporal mapping, all features written to the KML format can be assigned a number of time-related attributes. In this example, the KMLTimeSetter is used to relate features to a single timestamp (i.e. this feature relates to time X).

How to Expose Feature Attributes from KML Tags or HTML Tables

In Google Earth, attributes are visible in the KML description balloon. This tutorial will demonstrate two different methods for exposing those attributes, depending on how your data is structured. 

Using Google's Chart API to Create Charts from a CSV and Shapefile

Learn how to create KML charts with Google's Chart API from CSV and shapefile that can be viewed with Google Earth.

Creating a KML ScreenOverlay or Watermark

FME KML Watermarks offer users a straightforward way to brand their KML. KML ScreenOverlay enables users to have greater control over the positioning of their ScreenOverlay images. This article will cover how to create both a Watermark and a ScreenOverlay element at a position other than 0,0.

Label Google Earth Polygons

In addition to labeling points in KML, it is possible to label other geometries, such as polygons. To draw an icon and label in Google Earth, a point and a Placemark are necessary. 

Highlight KML Icons & Labels

Using KML StyleMap elements, learn how to create labels and icons with the highlight-on-hover functionality.

Creating KML Folders By Feature Type Fanout

This article describes what KML folders are and how to create them using the simpler method of feature type fanout. 

Creating KML Folders Through KML IDs

This article walks you through how to create folders using KML IDs, a more complex method than feature type fanout, but it is fully customizable. 

How to use Google Earth to Georeference / Geocode KML files

Normally, when writing to Google Earth KML files, FME users will write out locations as points. However, if you do not have location data, but only addresses, you will need to use a geocoding service to generate lat/long points.

Optimizing Large Datasets for KML and Google Earth

Splitting large datasets into smaller pieces is useful for displaying data in Google Earth. A single workspace creates both the KML Network link file and the tiled KML datasets. 

Earthquake KML Streaming Example

This example guides users through the process of easily streaming data using the sample dataset in FME Flow. 

Was this article helpful?

We're sorry to hear that.

Please tell us why.

As of January 14th, 2026, comments on knowledge base articles have been closed. To make sure questions don’t get missed and to enable more community support, we’ve moved discussions to the FME Community. If you have a question or a comment about this article, please create a new post or create a support ticket.