KML examples

Given the wide range of GIS data being created and the many display options in KML, there is an incredible variety in how geographic data can be represented as KML. In many cases, the data is two-dimensional in nature, and the KML can be authored using ArcMap. In other cases, there may be a 3D aspect to the data that requires authoring using ArcGlobe or ArcScene.

Below are some examples of KML created using ArcGIS Desktop.

Publishing points as KML placemarks

A franchised accounting business named Accountant Bob has offices all over the country, and it wants to display its geographic locations on a virtual globe as a method of advertising online. Each office has its own distinct home Web page, on a shared Web address, that provides details about the business. One possible workflow for exposing this information as KML is detailed below.

Data preparation

  1. Create a point feature class containing the accounting office locations by geocoding each office's address.
  2. Define an attribute on the feature class that can be used to generate each office's Web page URL. For example, each office's URL is simply the main Accountant Bob Web page of http://www.accountantbob.com with an appended office1.html, so an attribute value of Office1, Office2, and so on, would be required for all features.
    The attributes of the point feature class includes the office identifier and the city name.
    The attributes of the point feature class includes the office identifier and the city name.

Layer preparation

  1. In ArcMap, set the layer's name to Accountant Bob Offices.
  2. Set the layer's description to include details about the accounting services provided.
    Set the layer name and description on the General tab of the Layer Properties dialog box.
    Set the layer name and description on the General tab of the Layer Properties dialog box.
  3. Set the point symbology for the layer to a gold star.
  4. Set the layer's label expression to the office's City attribute value.
    The point layer has been symbolized by a gold star, and the label expression is using the city name.
    The point layer has been symbolized by a gold star, and the label expression is using each office's city name.
  5. Set the HTML Popup properties to create the URL of the home page based on a combination of the OfficeID attribute and static text.
    HTML Popup properties

Map preparation

In this case, there are no requirements to author a map document, as the layer can be exported directly to KML.

KML creation and sharing

  1. In this case, there are no requirements to author a map document, as the layer can be exported directly to KML.
  2. Open the Layer to KML geoprocessing tool from the To KML folder of the Conversion Tools toolset.
    Run the Layer To KML geoprocessing tool from the ArcToolbox window.
    Run the Layer To KML geoprocessing tool from the ArcToolbox window.
  3. Fill in the parameters of the Layer To KML tool and create the zipped KML file.
    Fill in the Layer To KML geoprocessing tool and click OK.
  4. Preview the KML file in any application that is capable of displaying the data format.
    KML display in ArcGIS Explorer
    Placemark points, displayed as KML inside ArcGIS Explorer
  5. Post the KML file to a public location so search engines, such as Google's, can include the content in their search results.
Potential clients can then find the KML content through an Internet search and view the information on a virtual globe.

Publishing a map as a KML ground overlay

Imagine that a local government has a map showing the planned rezoning of a residential area. It would like to make this map available for the residents of the city to review and potentially contest the change. By sharing the map as KML, the local government can provide the geographic information of the change, as well as provide links to Web pages for direct citizen feedback. One possible workflow for exposing this information as KML is detailed below.

Data preparation

  1. The source road and land records data has been developed and maintained by the local government over many years. The data includes a street names annotation layer, a parcels polygon layer, a land-use polygon layer, and a building footprints polygon layer.
  2. To create this dedicated map, a subset of the maintained features was exported to a separate database, with the peripheral features split to create a squared outline.

Layer preparation

  1. In ArcMap, set the layer symbology for the buildings, parcel boundaries, and zoning layers. Note that when this map is exported to KML, the street names are not needed, as most KML viewing applications include the street name information.
    Symbolized map document
    Symbolized map document

Map preparation

  1. Turn off the Street Names layer so it will not be included in the exported KML.
  2. Update the name of the data frame to Proposed Rezoning Map. This will be used as the main node name when the map is exported to KML.
  3. Include HTML links inside the description of the data frame. These links will be available when the top-level node is clicked as a KML, providing the consumer with easy access to the referenced sites. Full HTML formatting can be used, if desired.
    Set the data frame properties
  4. Switch to Layout View and create a Legend for the map. This legend will be displayed as a Screen Overlay when the KML is viewed and will explain the proposed zoning change visually.
  5. Save the map document.
    Add a Legend to the map and save it.

KML creation and sharing

  1. Open the Map To KML geoprocessing tool from the To KML folder of the Conversion Tools toolset.
  2. Fill in the parameters of the Map To KML tool and create the zipped KML file.
    Fill in the Map To KML geoprocessing tool and click OK.
  3. Preview the KML file in any application that is capable of displaying the data format.
    Rezoning information displayed as KML in Google Earth
    Image courtesy of Google Earth
  4. Post a link to the KML file on the local government's Web site, which allows the public to download and view the information on a virtual globe.

Publishing 3D vector features as KML

A university has done a study on the noise levels of aircraft as they approach a local airport. It would like to share these findings in a three-dimensional geographic context, such as a virtual globe. Some of the data, such as the flight approach paths, are inherently 3D. Other data, such as the polygon areas representing classified noise pollution levels, are 2D in nature, but the university would like to symbolize them in a 3D way using extrusion. One possible workflow for exposing this information as KML is detailed below.

Data preparation

  • Create a 3D line feature class from a textual description of the flight path of bearings, distances, and elevation.
  • Create the polygon areas of similar noise levels by classifying a raster surface representing the noise pollution from the approaching planes.

Layer preparation

  1. In ArcGlobe, display the flight path data as a Floating layer.
  2. Add in the polygon data and set the layer to use a classification renderer and partial transparency.
    Symbolized ArcGlobe document
  3. Set the polygon extrusion height based on the level of noise pollution.
    Set the extrusion for the polygon layer.

Map preparation

  1. Open ArcMap and copy across the flight path and extruded zone layers from ArcGlobe. The 3D properties authored inside ArcGlobe are maintained with the layers when they are brought into ArcMap.
  2. Set the name of the data frame to Flight path noise study.
  3. Optionally, include a Legend to provide a Screen Overlay image for the KML.
  4. Save the map document.
    ArcGlobe layers brought into ArcMap
    Authored layers from ArcGlobe brought into ArcMap

KML creation and sharing

  1. Open the Map to KML geoprocessing tool from the To KML folder of the Conversion Tools toolset.
  2. Fill in the parameters of the Map To KML tool and create the zipped KML file.
    Fill in the Map To KML geoprocessing tool and click OK.
  3. Preview the KML file in any application that is capable of displaying the data format.
    KML display inside ArcGlobe
    Extruded noise areas, displayed as KML inside ArcGlobe
  4. Include the KML on the university's Web portal, allowing it to be downloaded and viewed.


1/21/2011