Copyright © 2014 Open Geospatial Consortium
5
5 KML as a format for exchange and visualization of NAS data
5.1 Identifying the appropriate representation of NAS data in KML
5.1.1 Encoding Options
5.1.1.1 Overview
KML 2.2 offers the kml:ExtendedData element that enables the inclusion of additional data elements in a KML placemark. The kml:ExtendedData element offers three
mechanisms for adding user-defined data to a feature. These mechanisms are:
- adding arbitrary untyped namevalue data pairs using the kml:Data element - adding instances of typed fields defined in the user-defined kml:Schema element, plus
additional elements in some other namespace - including any XML content defined in namespaces other than the KML namespace
A simple KML file with three polygon features was used to test which extended data is presented in clients - and how. Each option was encoded in one feature as discussed
below.
5.1.1.2 Building-1: Using kml:Data
In this example, five data elements are included in the ExtendedData element. These are just name-value-pairs without any differentiation of types. An optional display name can
be provided with HTML tag to show how the data element should be presented. The use of the CDATA wrapper ensures that HTML formatting elements are preserved for use by
the client inside of the KML placemark “balloon” presentation.
ExtendedData Data name=type
displayName[CDATA[bTypeb]]displayName value
[CDATA[ a href=https:www.dgiwg.orgFADfddview?i=111415
Building a]]
value Data
Data name=height displayName[CDATA[bHeightb]]displayName
value54 ftvalue Data
Data name=stories displayName[CDATA[bStoriesb]]displayName
value3value Data
Data name=building type displayName
[CDATA[ b
a href=https:www.dgiwg.orgFADfddview?i=100853
6
Copyright © 2014 Open Geospatial Consortium
Educational facility type a
b ]]
displayName value
[CDATA[ a href=https:www.dgiwg.orgFADfddview?i=103456Schoola
a href=b3Building-3a ]]
value Data
ExtendedData
Advantages: - no schema required
- easy to parse - display information available for KML clients CDATA-wrapped
Disadvantages: - only simple types
- display names have to be repeated for every feature instance - no type information
5.1.1.3 Building-2: Test feature using kml:Schema and kml:SchemaData
Similar four data elements to the ones in Bulding-1 above have been specified, in addition some elements which are in the substitution group of kml:SchemaDataExtension
in the instance or kml:SchemaExtension in the schema description are added. These are just name-value-pairs without any differentiation of types. An optional display name
can be provided with HTML tag to show how the data element should be presented.
ExtendedData SchemaData schemaUrl=BuildingTypeId
xmlns:test=http:www.opengis.netows7test SimpleData name=type
[CDATA[ a href=https:www.dgiwg.orgFADfddview?i=111415Buildinga
]] SimpleData
SimpleData name=height54 ftSimpleData SimpleData name=stories3SimpleData
SimpleData name=building type [CDATA[
a href=https:www.dgiwg.orgFADfddview?i=103456Schoola a href=b3Building-3a
]]
SimpleData test:element1Testtest:element1
test:element2 attribut=test