DataArray Element Requirements Class: Block Components Schema Requirements Class

OGC 08-094r1 SWE Common Data Model complexType element element name = encoding minOccurs = complexType sequence element ref = swe:AbstractEncoding sequence complexType element element name = values type = swe:EncodedValuesPropertyType minOccurs = sequence extension complexContent complexType The size of the array is given by the “elementCount” property element which takes a “Count” data component. It can be used to construct both fixed size and variable size arrays. When the “Count” child element of the “elementCount” property includes an inline value, the array has a fixed size indicated by the value. When the “Count” child element has no inline value or when the “elementCount” has an “xlink:href” attribute, the array has a variable size. The “elementType” property carries the definition of a single array element while the “encoding” and “values” properties allow including the array data inline as an efficient encoded data block. When present, this data block contains values for all elements of the array the number of elements is given by the array size. The “values” element shall contain or reference a block of encoded values that are properly structured by following one of the encoding rule sets described in section 9. Requirement http:www.opengis.netspecSWE2.0reqxsd-block-componentsencoded-values-valid Req 73. The encoded data block included either inline or by‐reference in the “values” property of a “DataArray”, “Matrix” or “DataStream” element shall be structured according to the definition of the element type, the element count and the encoding rules corresponding to the chosen encoding method. This first example shows how the “DataArray” element can be used to define a fixed size array of several measurement records and give their values inline as an encoded data block: swe:DataArray definition = http:sweet.jpl.nasa.gov2.0info.owlTimeSeries swe:description Array of synchronous weather measurements swe:description swe:elementCount swe:Count swe:value 3 swe:value swe:Count swe:elementCount swe:elementType name = weather_measurement swe:DataRecord swe:label Weather Data Record swe:label swe:field name = time swe:Time definition = http:www.opengis.netdefpropertyOGC0SamplingTime swe:label Sampling Time swe:label 98 Copyright © 2011 Open Geospatial Consortium SWE Common Data Model OGC 08-094r1 swe:uom xlink:href = http:www.opengis.netdefuomISO-86010Gregorian swe:Time swe:field swe:field name = temperature swe:Quantity definition = http:mmisw.orgontcfparameterair_temperature swe:label Air Temperature swe:label swe:uom code = Cel swe:Quantity swe:field swe:field name = pressure swe:Quantity definition = http:mmisw.orgontcfparameterair_pressure_at_sea_level swe:label Atmospheric Pressure swe:label swe:uom code = mbar swe:Quantity swe:field swe:DataRecord swe:elementType swe:encoding swe:TextEncoding blockSeparator = 10; tokenSeparator = , swe:encoding swe:values 2009-02-10T10:42:56Z,25.4,1020 2009-02-10T10:43:06Z,25.3,1021 2009-02-10T10:44:16Z,25.3,1020 swe:values swe:DataArray In this example, an array of 5 weather records is created. Each element of the array is a record of 3 values: the measurement sampling time, a temperature value and a pressure value. The array values are encoded as text tuples, and since the array size is 5, there are 5 tuples in the “values” element in this case each line is a new tuple since the block separator is a ‘new line’ character. See clauses 8.5 and 8.6 for more information on “TextEncoding” and other encoding methods. Note that this example also requires conformance to the “Record Components Schema” requirements class. The next example illustrates how a dataset field containing variable length trajectory data can be defined: swe:DataArray definition = http:sweet.jpl.nasa.gov2.0info.owlTrajectory swe:description Mobile Trajectory swe:description swe:elementCount swe:Count swe:elementCount swe:elementType name = point swe:Vector definition = http:sweet.jpl.nasa.gov2.0space.owlLocation referenceFrame = http:www.opengis.netdefcrsEPSG04326 swe:label Location Point swe:label swe:coordinate name = lat swe:Quantity definition = http:sweet.jpl.nasa.gov2.0spaceCoordinates.owlLatitude axisID = Lat swe:label Latitude swe:label swe:uom xlink:href = deg swe:Quantity swe:coordinate swe:coordinate name = lon swe:Quantity definition = http:sweet.jpl.nasa.gov2.0spaceCoordinates.owlLongitude axisID = Long swe:label Longitude swe:label swe:uom code = deg swe:Quantity swe:coordinate swe:Vector swe:elementType swe:DataArray Copyright © 2011 Open Geospatial Consortium 99 OGC 08-094r1 SWE Common Data Model In this case, the “elementCount” value is not specified indicating that there will be an integer number specifying the array size in the data corresponding to the “Count” representation before the array values themselves. The array data will then contain several pairs of LatLon values, each representing one array element. Note that neither the “encoding” or “values” properties are present in this example as the “DataArray” is used as a data descriptor. The “definition” attribute on the array gives useful information about its content. Several “DataArray” elements can be nested to form multidimensional arrays. The following example shows how to fully define the structure of an image by using arrays: swe:DataArray definition = http:sweet.jpl.nasa.gov2.0info.owlRaster swe:elementCount swe:Count swe:value 3000 swe:value swe:Count swe:elementCount swe:elementType name = row swe:DataArray definition = http:sweet.jpl.nasa.gov2.0info.owlRow swe:elementCount swe:Count swe:value 3000 swe:value swe:Count swe:elementCount swe:elementType name = pixel swe:DataRecord definition = http:sweet.jpl.nasa.gov2.0info.owlCell swe:field name = band1 swe:Quantity definition = http:sweet.jpl.nasa.gov2.0physRadiation.owlRadiance swe:description Radiance measured on band1 swe:description swe:uom code = W.m-2.Sr-1 swe:Quantity swe:field swe:field name = band2 swe:Quantity definition = http:sweet.jpl.nasa.gov2.0physRadiation.owlRadiance swe:description Radiance measured on band2 swe:description swe:uom code = W.m-2.Sr-1 swe:Quantity swe:field swe:field name = band3 swe:Quantity definition = http:sweet.jpl.nasa.gov2.0physRadiation.owlRadiance swe:description Radiance measured on band3 swe:description swe:uom code = W.m-2.Sr-1 swe:Quantity swe:field swe:DataRecord swe:elementType swe:DataArray swe:elementType swe:DataArray This example describes a 3000x3000 pixels image with three components. The image is organized by rows and the bands are interleaved by pixel. It is possible to describe different interleaving patterns by reversing the nesting order of the components.

8.4.2 Matrix Element

The “Matrix” element is the XML schema implementation of the “Matrix” UML class defined in clause 7.5.2. The schema snippet for this element and its corresponding complex type is shown below: 100 Copyright © 2011 Open Geospatial Consortium SWE Common Data Model OGC 08-094r1 element name = Matrix type = swe:MatrixType substitutionGroup = swe:AbstractDataComponent complexType name = MatrixType complexContent extension base = swe:AbstractDataComponentType sequence element name = elementCount type = swe:CountPropertyType element name = elementType complexType complexContent extension base = swe:AbstractDataComponentPropertyType attribute name = name type = NCName use = required extension complexContent complexType element element name = encoding minOccurs = complexType sequence element ref = swe:AbstractEncoding sequence complexType element element name = values type = swe:EncodedValuesPropertyType minOccurs = sequence attribute name = referenceFrame type = anyURI use = required attribute name = localFrame type = anyURI use = optional extension complexContent complexType The “Matrix” element is a special case of “DataArray” that adds “referenceFrame” and “localFrame” attributes for expressing the array components in a well defined reference frame. As opposed to the “Vector” component, the axis order is implied in a matrix because it is difficult to assign a frame axis to each individual element of an N- dimensional array. The array index in each dimension is thus used as the axis index in the ordered list provided by the reference frame. The following example shows how to encode a rotation matrix: swe:Matrix definition = http:sweet.jpl.nasa.gov2.0spaceDirection.owlOrientation referenceFrame = http:www.opengis.netdefcrsOGC0ECI_WGS84 swe:elementCount swe:Count swe:value 3 swe:value swe:Count swe:elementCount swe:elementType name = row swe:Matrix definition = http:sweet.jpl.nasa.gov2.0info.owlRow swe:elementCount swe:Count swe:value 3 swe:value swe:Count swe:elementCount swe:elementType name = coef swe:Quantity definition = http:sweet.jpl.nasa.gov2.0mathVector.owlCoordinate swe:uom code = 1 swe:Quantity swe:elementType swe:Matrix swe:elementType swe:encoding swe:TextEncoding blockSeparator = tokenSeparator = , swe:encoding swe:values 0.36,0.48,-0.8 -0.8,0.6,0 0.48,0.64,0.6 swe:values swe:Matrix Copyright © 2011 Open Geospatial Consortium 101