OGC 08-094r1 SWE Common Data Model
Requirement
http:www.opengis.netspecSWE2.0reqgeneral-encoding-ruleschoice-encoding-rule
Req 87. Encoded values for the selected item of a “DataChoice” shall be provided
along with information that unambiguously identifies the selected item.
9.1.5 Rules for DataArray and Matrix
The “DataArray” is an aggregate consisting of a number of repeated elements, all of the same type as defined by the element type. Values contained by a “DataArray” are
encoded by sequentially including the values of each element.
The definition of a “DataArray” “Matrix” structure composed of the array dimension and size and the element type definition. This can be represented in the following way:
Definition of Array Element
Definition of Array Dimension
DataArray definition
The data block corresponding to such a structure would sequentially include the number representing the array size only if it is variable followed by one or more values
corresponding to each array element. The number of values encoded for each element depends only on the array element definition, and the total number of values also depends
on the array size.
Requirement
http:www.opengis.netspecSWE2.0reqgeneral-encoding-rulesarray-encoding-rule
Req 88. “DataArray” elements shall be encoded sequentially in a data block in the
order of their index in the array i.e. from low to high index.
Requirement
http:www.opengis.netspecSWE2.0reqgeneral-encoding-rulesarray-size-encoding-rule
Req 89. Encoded data for a variable size “DataArray” shall include a number
specifying the array size whatever the encoding method used.
118
Copyright © 2011 Open Geospatial Consortium
SWE Common Data Model OGC 08-094r1
9.2 Requirements Class: Text Encoding Rules Requirements Class
http:www.opengis.netspecSWE2.0reqtext-encoding-rules
Target Type Encoded Values Instance
Dependency
http:www.opengis.netspecSWE2.0requml-simple-encodings
Dependency
http:www.opengis.netspecSWE2.0reqgeneral-encoding-rules
The “TextEncoding” method encodes field values especially numbers by their text representation. Special characters provide a way to separate successive values and
successive blocks. The ABNF syntax defined in IETF RFC 5234 is used to formalize the encoding rules, and thus all ABNF snippets provided in this section are normative.
Requirement
http:www.opengis.netspecSWE2.0reqtext-encodings-rulesabnf-syntax-valid
Req 90. The encoded values block shall be formatted as defined by the ABNF
grammar defined in this clause.
9.2.1 Separators
Token separators are used between single values and the block separator is used at the end of each block. The block corresponds to one element of the “DataArray” or
“DataStream” carrying the “values” element in which the values are encoded. There are no special separators to delimitate nested records, arrays and choices.
Separators shall be chosen so that nothing in the dataset contains the exact same character sequence as the one chosen for token or block separator.
Requirement
http:www.opengis.netspecSWE2.0reqtext-encoding-rulesseparators-valid
Req 91. Block and token separators used in the “TextEncoding” method shall be
chosen as a sequence of characters that never occur in the data values themselves.
When the attribute “collapseWhiteSpaces” is set to true its default value, all white space characters surrounding the token and block separators shall be ignored. The BNF
grammar for separators is given below:
white-space = d9 d10 d13 d32 ; TAB, LF, CR or SPACE token-separator-chars = Value of the tokenSeparator attribute
Copyright © 2011 Open Geospatial Consortium
119