SWE Common Data Model OGC 08-094r1
data component and thus cannot be nested into other aggregates. It can only serve as a root object to represent the data stream as a whole.
The next example shows how it is used to describe a real time stream of aircraft navigaton data:
swe:DataStream swe:label
Aircraft Navigation swe:label
swe:elementType name
= navData
swe:DataRecord swe:field
name =
time swe:Time
definition =
http:www.opengis.netdefpropertyOGC0SamplingTime referenceFrame
= http:www.opengis.netdeftrsOGC0GPS
referenceTime =
1970-01-01T00:00:00Z swe:uom
code =
s swe:Time
swe:field swe:field
name =
location swe:Vector
definition =
http:www.opengis.netdefpropertyOGC0PlatformLocation referenceFrame
= http:www.opengis.netdefcrsEPSG04979
swe:coordinate name
= lat
swe:Quantity definition
= http:sweet.jpl.nasa.gov2.0spaceCoordinates.owlLatitude
axisID =
Lat swe:uom
code =
deg swe:Quantity
swe:coordinate swe:coordinate
name =
lon swe:Quantity
definition =
http:sweet.jpl.nasa.gov2.0spaceCoordinates.owlLongitude axisID
= Long
swe:uom code
= deg
swe:Quantity swe:coordinate
swe:coordinate name
= alt
swe:Quantity definition
= http:sweet.jpl.nasa.gov2.0spaceExtent.owlAltitude
axisID =
h swe:uom
code =
m swe:Quantity
swe:coordinate swe:Vector
swe:field swe:field
name =
attitude swe:Vector
definition =
http:www.opengis.netdefpropertyOGC0PlatformOrientation referenceFrame
= http:www.opengis.netdefcrsOGC0ENU
swe:coordinate name
= heading
swe:Quantity definition
= http:sweet.jpl.nasa.gov2.0spaceCoordinates.owlYaw
axisID =Z
swe:uom code
= deg
swe:Quantity swe:coordinate
swe:coordinate name
= pitch
swe:Quantity definition
= http:sweet.jpl.nasa.gov2.0spaceCoordinates.owlPitch
axisID =X
swe:uom code
= deg
swe:Quantity swe:coordinate
swe:coordinate name
= roll
swe:Quantity definition
= http:sweet.jpl.nasa.gov2.0spaceCoordinates.owlRoll
axisID =Y
swe:uom code
= deg
swe:Quantity swe:coordinate
swe:Vector swe:field
swe:DataRecord swe:elementType
swe:encoding swe:TextEncoding
tokenSeparator =
, blockSeparator
= 10;
decimalSeparator =
. swe:encoding
swe:values xlink:href
= rtp:myserver:4563navData
swe:DataStream
Copyright © 2011 Open Geospatial Consortium
103
OGC 08-094r1 SWE Common Data Model
This example defines a stream of homogeneous records, each of which is composed of a time stamp, 3D aircraft location expressed in the EPSG 4979 WGS 84 LatLonAlt
coordinate reference system, and aircraft attitude expressed relative to the local ENU East-North-Up coordinate frame. The actual data values would then be sent via the RTP
connection in the following text CSV format:
1257691405,41.55,13.61,325,90.5,1.2,1.1 1257691410,41.55,13.62,335,90.4,1.3,0.5
1257691415,41.55,13.63,345,90.5,1.3,0.1 1257691420,41.55,13.64,355,90.4,1.2,-1.1
1257691425,41.55,13.65,365,90.5,1.2,-0.5 ...
Note that the “encoding” and “values” properties are mandatory on the “DataStream” element, indicating that it can only be used to describe the dataset as a whole, along with
its encoding method. The “values” element is usually used to provide a reference to the actual data stream i.e. the values.
Note that streams of heterogeneous records can also be described by using a “DataChoice” as the element type. This is shown below:
104
Copyright © 2011 Open Geospatial Consortium
SWE Common Data Model OGC 08-094r1
8.5 Requirements Class: Simple Encodings Schema Requirements Class
http:www.opengis.netspecSWE2.0reqxsd-simple-encodings
Target Type XML Instance
Dependency
http:www.opengis.netspecSWE2.0requml-simple-encodings
Dependency
http:www.opengis.netspecSWE2.0reqtext-encoding-rules
Dependency
http:www.opengis.netspecSWE2.0reqxml-encoding-rules
XML Schema elements and types defined in the “simple_encodings.xsd” schema implement all classes defined in the “Simple Encodings” UML packages.
Requirement
http:www.opengis.netspecSWE2.0reqxsd-simple-encodingsschema-valid
Req 74. The XML instance shall be valid with respect to the grammar defined in the
“simple_encodings.xsd” XML schema as well as satisfy all Schematron patterns
defined in “simple_encodings.sch”.
This requirements class defines a set of core encodings that have been chosen to cover the needs of simple applications that need to encode data as efficient data blocks. The
“TextEncoding” method allows encodings datasets in a human readable textual format, while the “XMLEncoding” method allows encoding data with light weight XML tagged
values.
Note: It is not the intent of this standard to support legacy formats by simply wrapping them with an XML description. Implementations seeking comformance to this
requirements class will most often have to re-encode existing data by following the encoding rules described in this clause. However the encoding model has been designed
and tested so that re-encoding can be done very efficiently on-the-fly without requiring the pre-processing of large amounts of existing data.
8.5.1 AbstractEncoding Element
The “AbstractEncoding” element is the XML schema implementation of the “AbstractEncoding” UML class defined in clause 7.6. The schema snippet for this
element and its corresponding complex type is shown below:
element name
= AbstractEncoding
type =
swe:AbstractEncodingType abstract
= true
substitutionGroup =
swe:AbstractSWE complexType
name =
AbstractEncodingType abstract
= true
Copyright © 2011 Open Geospatial Consortium
105
OGC 08-094r1 SWE Common Data Model
complexContent extension base=
swe:AbstractSWEType complexContent
complexType
This element serves as the substitution group for all XML elements that describe encoding methods in this standard or in extensions of this standard.
8.5.2 TextEncoding Element
The “TextEncoding” element is the XML schema implementation of the “TextEncoding” UML class defined in clause 7.6.1. The schema snippet for this element and its
corresponding complex type is shown below:
element name
= TextEncoding
type =
swe:TextEncodingType substitutionGroup
= swe:AbstractEncoding
complexType name
= TextEncodingType
complexContent extension
base =
swe:AbstractEncodingType attribute
name =
collapseWhiteSpaces type
= boolean
use =
optional default
=true attribute
name =
decimalSeparator type
= string
use =
optional default
=. attribute
name =
tokenSeparator type
= string
use =
required attribute
name =
blockSeparator type
= string
use =
required extension
complexContent complexType
This element is used to specify encoding of data values in a “Delimiter Separated Values” format a generalization of CSV that is parameterized by its 4 XML attributes. The exact
encoding rules to be followed are specified in clause 0.
Requirement
http:www.opengis.netspecSWE2.0reqxsd-simple-encodingstext-encoding-rules-applied
Req 75. The encoded values block described by a “TextEncoding” element shall pass
the “Text Encoding Rules” conformance test class.
The following example shows a set of commonly used parameters:
swe:TextEncoding tokenSeparator
= ,
blockSeparator =
The “decimalSeparator” and “collapseWhiteSpaces” attributes have been omitted to indicate that their default values should be used. This leads to a data stream where
individual tokens are separated by commas i.e. the ‘,’ character, while complete blocks are separated by spaces. It can for example be used to encode coordinate tuples of
“lat,lon,lat” values in a very readable manner, such as:
25.41,10.23,320 25.43,10.23,300 25.39,11.51,310
106
Copyright © 2011 Open Geospatial Consortium