KML 2.2 is the OGC standard 07-147r2, namespace
http://www.opengis.net/kml/2.2. This page follows its XML Schema,
ogckml22.xsd,
read 2026-11-12. Elements are grouped by the abstract types they derive from, and
child elements appear in a fixed order. Google’s gx: extensions are a
separate schema, not covered here.
Features
Every feature can have: name, visibility (0 or 1),
open, atom:author, atom:link,
address, xal:AddressDetails, phoneNumber,
Snippet (or the older snippet), description,
a view, a time primitive, styleUrl, inline styles, a
Region, Metadata (deprecated) and
ExtendedData.
| Element | Kind | Own children |
|---|---|---|
Document | Container | Schema definitions, then features. Shared styles live here. |
Folder | Container | Features. |
Placemark | Feature | One geometry. |
NetworkLink | Feature | refreshVisibility, flyToView, Link (or the older Url): loads more KML from a URL. |
GroundOverlay | Overlay | altitude, altitudeMode, LatLonBox (north, south, east, west, rotation). |
ScreenOverlay | Overlay | overlayXY, screenXY, rotationXY, size, rotation. |
PhotoOverlay | Overlay | rotation, ViewVolume, ImagePyramid, Point, shape. |
Overlays share color, drawOrder and Icon.
Geometries
| Element | Children |
|---|---|
Point | extrude, altitudeMode, coordinates (one tuple). |
LineString | extrude, tessellate, altitudeMode, coordinates. |
LinearRing | As LineString; closed: first and last tuple the same, at least four. |
Polygon | extrude, tessellate, altitudeMode, outerBoundaryIs (one LinearRing), innerBoundaryIs (holes). |
MultiGeometry | Any geometries. |
Model | altitudeMode, Location, Orientation (heading, tilt, roll), Scale, Link to the model file, ResourceMap. |
coordinates holds tuples longitude,latitude[,altitude]
separated by white space, in WGS 84 degrees and metres.
Styles
StyleholdsIconStyle(scale,heading,Icon,hotSpot),LabelStyle(scale),LineStyle(width),PolyStyle(fill,outline),BalloonStyle(bgColor,textColor,text,displayMode) andListStyle(listItemType,bgColor,ItemIcon,maxSnippetLines).- The colour styles share
colorandcolorMode. Colours are 8 hex digits in the order alpha, blue, green, red:ff0000ffis opaque red. StyleMapholdsPairs ofkey(normalorhighlight) and a style orstyleUrl.
Views, time, regions and data
| Element | Children |
|---|---|
LookAt | longitude, latitude, altitude, heading, tilt, range, altitudeMode. |
Camera | longitude, latitude, altitude, heading, tilt, roll, altitudeMode. |
TimeStamp | when: an XML Schema date or time, as precise as needed (1997, 1997-07, 1997-07-16T07:30:15Z). |
TimeSpan | begin, end. |
Region | LatLonAltBox (north, south, east, west, minAltitude, maxAltitude, altitudeMode) and Lod (minLodPixels, maxLodPixels, minFadeExtent, maxFadeExtent). |
Link, Icon | href, refreshMode, refreshInterval, viewRefreshMode, viewRefreshTime, viewBoundScale, viewFormat, httpQuery. |
ExtendedData | Data (@name; displayName, value), SchemaData (@schemaUrl; SimpleData @name) or elements of other namespaces. |
Schema | @name; SimpleField (@type, @name; displayName). |
NetworkLinkControl | Top level, for files loaded by network links: minRefreshPeriod, maxSessionLength, cookie, message, linkName, linkDescription, linkSnippet, expires, Update (with targetHref and Create, Delete, Change), a view. |
Enumerations
| Element | Values |
|---|---|
altitudeMode | clampToGround (default), relativeToGround, absolute. |
colorMode | normal, random. |
refreshMode | onChange, onInterval, onExpire. |
viewRefreshMode | never, onStop, onRequest, onRegion. |
listItemType | check, checkOffOnly, checkHideChildren, radioFolder. |
displayMode | default, hide. |
key (StyleMap) | normal (default), highlight. |
state (ItemIcon) | A space-separated list of open, closed, error, fetching0, fetching1, fetching2. |
shape (PhotoOverlay) | rectangle, cylinder, sphere. |
gridOrigin (ImagePyramid) | lowerLeft, upperLeft. |
Units of hotSpot, overlayXY and the like | fraction, pixels, insetPixels. |
KMZ
Google’s KMZ
archives guide (read 2026-11-12) describes a .kmz file as a main KML
file and zero or more supporting files packed with a
ZIP utility. By default the main file is named
doc.kml; the guide says to put only one .kml file at the
top level, because Google Earth uses the first one it finds and ignores the rest.
Relative URLs inside it are resolved against the folder holding the main file, the
root of the archive.