DataArray Class Requirements Class: Block Components Package Requirements Class
OGC 08-094r1 SWE Common Data Model
values, as these will be block encoded in the “values” attribute of the parent “DataArray”.
Requirement
http:www.opengis.netspecSWE2.0requml-block-componentsarray-component-no-value
Req 49. Data components that are children of an instance of a block component
shall be used solely as data descriptors. Their values shall be block encoded in the
“values” attribute of the block component rather than included inline.
However, the “DataArray” class itself, like any other data component can be used either as a data descriptor or as a data container. To use it as a data descriptor the “encoding”
and “values” attributes are not set. To use it as a data container, these attributes are both set as described below.
The “encoding” and “values” fields are there to provide array data as an efficient block which can be encoded in several ways. The different encoding methods are described in
clauses 7.6 and 7.7. The “encoding” field shall have a value if the “values” field is present, and the data shall be encoded using the specified encoding.
Requirement
http:www.opengis.netspecSWE2.0requml-block-componentsarray-values-properly-encoded
Req 50. Whenever an instance of a block component contains values, an encoding
method shall be specified by the “encoding” property and array values shall be
encoded as specified by this method.
The choice of simple encodings defined in the “Simple Encodings” package allows encoding data as text using a delimiter separated values DSV, a variant of CSV format
or as XML tagged values. The “Advanced Encodings” package defines binary encodings that can be used to efficiently package large datasets.
By combining instances of “DataArray”, “DataRecord” and scalar components, one can obtain the complex data structures that are necessary to fully describe any kind of sensor
data.
Example
The “DataArray” class can be used to describe a simple 1D array of measurements such as radiance values obtained using a 12000 cells 1 row CCD strip for instance. This can be done by using the “Quantity” class as the element
type. In such a case, describing the dataset as a “DataRecord” would be a very repetitive task given the number of elements 12000 in this case
52
Copyright © 2011 Open Geospatial Consortium
SWE Common Data Model OGC 08-094r1
The possibility of nesting a “DataRecord” or “Vector” inside a “DataArray” allows the construction of arrays of more complex structures, useful to describe trajectories, profiles,
images, etc.
Example
The “DataArray” class can be used as a descriptor for a trajectory dataset by using a vector of [latitude, longitude] coordinates as its element type. Note that this can also be considered as a 1D coverage in a 2D CRS.
Since the “DataArray” class alone can only represent 1-dimensional arrays, the construction of multi-dimensional arrays is done by nesting “DataArray” objects inside
each other.
Example
The structure of panchromatic imagery data can be described with two nested arrays, which sizes indicate the two dimensions of the image. A “Quantity” is used as the element type of the nested array in order to indicate that the
repeated element of the 2D array is of type infrared radiance with a given unit.
In this example, the image is described as an array of rows, each row being an array of samples. It is also possible to describe an image as an array of columns by reversing the two dimensions. Note that this would change the order in
which the data values would appear in a stream by rows vs. by columns.
Each element is defined by the
nested Quantity component
describing the radiance value
and its unit. Inside array dimension = columns – Element count = 640
Outside array
dimension = rows
– Element
count = 480
… x 1000 …
Each element is defined by the nested
Vector component that itself has 2
coordinates.
Array dimension – Element count = 1000
Lat Lon
Lat Lon
Lat Lon
Lat Lon
Lat Lon
Lat Lon
Lat Lon
… x 12000 … Array dimension – Element count = 12000
Each element is defined i.e. unit,
semantics, quality, etc. by the nested
Quantity component.
Copyright © 2011 Open Geospatial Consortium
53
OGC 08-094r1 SWE Common Data Model
One powerful feature of the “DataArray” model is that it allows for the element count to be either fixed or variable, thus allowing the description of data streams with variable
number of repetitive elements as is often the case with many kinds of sensor.
In a fixed size array, the number of elements can be provided in the descriptor as an instance of the “Count” class with an inline value. This value is only present in the data
description and not in the encoded block of array values. The definition of the “Count” instance is not required.
In a variable size array, the “elementCount” attribute either contains an instance of the “Count” class with no value or references an instance of a “Count” class in a parent or
sibling data component. The value giving the actual array size is then included in the stream, before the array values themselves, so that the block can be properly decoded.
One obvious implementation constraint is that the value representing the array size must be received before the array values. This is detailed further in the XML implementation
section.
Examples
Argo profiling floats can measure ocean salinity and temperature profiles of variable lengths by diving at different depths and depending on the conditions. A variable size “DataArray” could be used to describe their output data as
well as a dataset aggregating data from several Argo floats. Variable size arrays can often be used to avoid unnecessary padding of fixed size array data. However for efficiency
reasons usually to enable fast random access wo preliminary indexation, padding can also be specified in SWE Common when using the binary encoding.
As with any other data component, the “name” and “description” can be used to better describe the array and more importantly the “definition” attribute can be used to formally
indicate the semantics behind the array.
Example
When a “DataArray” is used to package data relative to the spectral response of a sensor, the array “definition” attribute can be used to point to the formal out-of-band definition of the “spectral response” concept.
Similarly a “DataArray” used to describe the output data of an Argo float would have its “definition” attribute reference the formal definition of a “profile”.
The value of the “definition” attribute of the “Count” instance used as the “elementCount” is also especially important, since it is used to define the meaning of the
array dimension. Thanks to this, it is possible to tag the dimension of an array as spatial, temporal, spectral, or any other kind. However it is not mandatory as it is on other simple
components.
Examples
In the CCD strip example described as a 1D array, the array index is the cell number in the strip. In the 2D image example, the outer array index is the row number, while the inner array index is the column or
sample number.
54
Copyright © 2011 Open Geospatial Consortium
SWE Common Data Model OGC 08-094r1
In a 1D array representing a time series, the array index is along the temporal dimension. In a 2D array representing a spatial coverage, the two array indices are along spatial dimensions.
In a 3D array representing hyper-spectral imagery, the two first arrays have indices along spatial dimension while the most inner array is indexed along the spectral dimension.
This extra information can be used by software to make decisions or at least ask the user by providing him this information about how to represent or even interpolate the data.