NilValues Element Requirements Class: Basic Types and Simple Components Schemas Requirements Class
OGC 08-094r1 SWE Common Data Model
complexType name
= NilValuePropertyType
simpleContent extension
base =
token attribute
name =
reason type
= anyURI
use =
required extension
simpleContent complexType
This element allows specifying a list of nil value for a particular data component. The next example shows how it can be used to reserve values for indicating a bad
measurement in a radiation sensor data stream.
swe:Quantity definition
= http:sweet.jpl.nasa.gov2.0physRadiation.owlIonizingRadiation
swe:label Radiation Dose
swe:label swe:description
Radiation dose measured by Gamma detector swe:description
swe:nilValues swe:NilValues
swe:nilValue reason
= http:www.opengis.netdefnilOGC0BelowDetectionRange
-INF swe:nilValue
swe:nilValue reason
= http:www.opengis.netdefnilOGC0AboveDetectionRange
INF swe:nilValue
swe:NilValues swe:nilValues
swe:uom code
= uR
swe:Quantity
This means that if the “-INF” or “INF” values these are allowed values for a floating point representation are found in the data stream, they should not be taken as real
measurement values but instead carry a specific meaning that is given by the “reason” attribute. In this example, all other values i.e. all decimal numbers should be interpreted
as a radation dose expressed in micro-roentgens.
One important feature is that the “NilValues” object can be referenced instead of being included inline. In addition to allowing their definition in shared repositories, this also
enables sharing nil value definitions between several components of the same dataset. This is for instance useful for describing multispectral and hyperspectral images since all
bands in these types of images usually share the same nil values. The field representing the first band can then be defined as shown below:
swe:Count definition
= http:sweet.jpl.nasa.gov2.0physRadiation.owlRadiance
swe:label Band 1
swe:label swe:nilValues
swe:NilValues id=
NIL_VALUES swe:nilValue
reason =
http:www.opengis.netdefnilOGC0BelowDetectionRange swe:nilValue
swe:nilValue reason
= http:www.opengis.netdefnilOGC0AboveDetectionRange
255 swe:nilValue
swe:NilValues swe:nilValues
swe:Count
And the following bands can have a much shorter description as it just references the nil values group previously defined:
swe:Count definition
= http:sweet.jpl.nasa.gov2.0physRadiation.owlRadiance
swe:label Band 2
swe:label swe:nilValues
xlink:href =
NIL_VALUES swe:Count
... swe:Count
definition =
http:sweet.jpl.nasa.gov2.0physRadiation.owlRadiance swe:label
Band 33 swe:label
84
Copyright © 2011 Open Geospatial Consortium
SWE Common Data Model OGC 08-094r1
swe:nilValues xlink:href
= NIL_VALUES
swe:Count
An important requirement of nil values is that they shall be expressible with the data component data type in order to guarantee that they can be properly encoded. This is
enforced by a Schematron pattern.
For a field with a string data type i.e. “Category” and “Text” components, each nil value can be any string but it is recommended to use short upper case alphabetical tokens for
better readability.
For a field with a floating point data type i.e. “Quantity” and “Time” components, nil values are restricted to decimal numbers and the three special values ‘INF’, ‘-INF’,
‘NaN’. These tokens shall be used when encoding nil values using the “TextEncoding” method. It is recommended to use these values to represent nil reasons whenever possible
for clarity, but it is also possible to use special numbers such as ‘-9999’ or ‘9e99’, which are usually chosen outside of the sensor measurement range, for carrying NIL semantics.
For a field with an integer data type i.e. “Count” component, only integer numbers such as ‘255’ or ‘999’ can be used for expressing NIL values. These are usually chosen outside
of the measurement range, and in a way that the smallest possible data type can be used to store the data in memory i.e. reserved values should be outside of the measurement
range but as small as possible.