KML

Long name

OGC KML
OGC KML Zipped

Short name KML, KMZ
File extension(s) .kml, .kmz

The Open Geospatial Consortium (OGC®) KML1 format (version 2.2) is supported in GDB as a vector and write-only format. Only one layer containing points, lines, and whole polygons is supported. The vector layer represents one placemark in the KML file. The vector layer's name and description are used for the placemark's name and description. The layer attributes, however, are not supported in KML.

When writing to KML, GDB sets the line color to random and the polygon fill to off. Representation information and view settings are not included.

For polygons with rings, GDB sets the first ring as the outer ring and the rest as inner rings. In addition, GDB converts topological polygons to whole polygons and topological line layers to lines.

KML 2.2 supports only the Lat/Long WGS84 projection, therefore, GDB automatically reprojects all shape coordinates to Lat/Long WGS84, if necessary. GDB also requires a large amount of memory when writing large vector layers to KML. This is because GDB stores the vector layers in memory while writing the KML file.

The KML vector layer supports 3D coordinates, which are the z values expressed in meters and in mean sea level (MSL) datum. GDB automatically converts the z values of a vector layer to this convention. The GDB elevation unit metadata tag is MD_ELEVATION_UNITS. If the units are not expressed in meters, GDB converts the units to meters. If the units are not specified, GDB assumes meters as the units. Similarly, the GDB elevation datum metadata tag is MD_ELEVATION_DATUM. If the datum is not expressed in MSL, GDB converts the datum to MSL and if the datum is not specified, GDB assumes MSL as the datum.

The z value can be specified using one of the following GDB option string:

z=  | The z value is not specified; the lines are left to contour to the underlying terrain in Google Earth.
z=(z-coord)  | The existing z-coordinates are written to the output.
z=ATTRIBUTE  | The z-coordinate of the lines are replaced with the numeric value corresponding to the "ATTRIBUTE". The "ATTRIBUTE" is defined in the segment's Attribute table.

By specifying a z value or leaving it blank, you can manipulate the look of lines in Google Earth. GDB processes the z value of lines using the KML- supported altitudeMode and tessellate tags.

If you specify the z value with a z-coordinate or attribute value, GDB sets the altitudeMode to absolute and does not specify tessellate. This results in lines appearing in Google Earth at the specified z value. The lines dip out of sight in areas where the Google Earth elevation value is higher than the z value.

If you do not specify the z value, GDB sets altitudeMode to clampToGround and tessellate to 1. This results in the lines appearing on the ground and contouring to the underlying Google Earth terrain.

Exporting to KML or KMZ

If you want to export rasters to KML, you can use the EXPORT2KML function in EASI or Modeler. This function also allows you to export vector layers.

For more information about KML 2.2, go to opengeospatial.org, and then search for "KML".

KMZ Format

KMZ is a compressed (zipped) KML file. GDB supports the KMZ file format for write-only.

1 formerly Keyhole Markup Language

© PCI Geomatics Enterprises, Inc.®, 2024. All rights reserved.