Extended Data

KML 2.2 provides the option to store attribute data in individual placemarks using either <Data> or <SchemaData> elements. For background, please read: http://code.google.com/apis/kml/documentation/extendeddata.html.

The key distinction between Data, and SchemaData is that SchemaData elements are associated with formal schema definitions in <Schema> elements.

The following element attributes are used by the KML reader and writer to read/write KML 2.2 extended data.

The KML reader and writer use a set of kml_data and kml_schema_data structured list attributes to read/write extended data.

KML Element Attribute

KML Element

kml_data{}.name

name attribute of <Data>

kml_data{}.value

<Data><value>

kml_data{}.display_name

<Data><displayName>

Optional.

Note: xml entities will be encoded on writing.

kml_data{}.display_name_raw_text

<Data><displayName>

Optional.

Note: Display_name values will written as raw text, i.e., xml entities will not be encoded. CDATA blocks should be added as necessary.

kml_schema_url

schemaUrl attribute of <SchemaData>

kml_schema_data{}.name

name attribute of <SimpleData>

kml_schema_data{}.value

Value of <SimpleData>