NilValues Class Requirements Class: Basic Types and Simple Components Packages Requirements Class

OGC 08-094r1 SWE Common Data Model Requirement http:www.opengis.netspecSWE2.0requml-simple-componentsnil-value-type-coherent Req 35. The value used in the “value” property of an instance of the “NilValue” class shall be compatible with the datatype of the parent data component object. This means that when specifying NIL values for a “Quantity” component, only real values are allowed in most implementations, this includes NaN, -INF and INF and for a “Count” component only integer values are allowed. Consequently, it is also impossible to specify NIL values for a “Boolean” data component since it allows only two possible values. In this case a “Category” component should be used. There are no restrictions on the choice of NIL values for “Category” and “Text” components since their datatype is String.

7.2.17 AllowedTokens Class

The “AllowedTokens” class is used to express constraints on the value of a data component represented by a “Text” or a “Category” class. The UML class is shown below: Allow edTokens «property» + value: CharacterString [0..] + pattern: CharacterString [0..1] Figure 7.20 – AllowedTokens Class This class allows defining the constraint either by enumerating a list of allowed values by using one or more “value” attributes andor by specifying a pattern that the value must match. The value must then either be one of the enumerated tokens or match the pattern.

7.2.18 AllowedValues Class

The “AllowedValues” class is used to express constraints on the value of a data component represented by a “Count” or a “Quantity” class. The UML class is shown below: 40 Copyright © 2011 Open Geospatial Consortium SWE Common Data Model OGC 08-094r1 Allow edValues «property» + value: Real [0..] + interval: RealPair [0..] + significantFigures: Integer [0..1] Figure 7.21 – AllowedValues Class This class allows constraints to be defined either by enumerating a list of allowed values andor a list of inclusive intervals. To be valid, the value must either be one of the enumerated values or included in one of the intervals. The numbers used in the “value” and “interval” properties shall be expressed in the same unit as the parent data component. Requirement http:www.opengis.netspecSWE2.0requml-simple-componentsallowed-values-unit-coherent Req 36. The scale of the numbers used in the “enumeration” and “interval” properties of an instance of the “AllowedValues” class shall be expressed in the same scale as the values that the constraint applies to. If the parent data component instance is used to define a projected quantity i.e. when the “axisID” is set, then the constraints given by this class are expressed along the same spatial reference frame axis. The number of significant digits can also be specified with the “significantFigures” property though it is only applicable when used with a decimal representation i.e. within the “Quantity” class. This limits the total number of digits that can be included in the number represented whether a scientific notation is used or not. Examples All non-zero digits are considered significant. 123.45 has five significant figures: 1, 2, 3, 4 and 5 Zeros between two non-zero digits are significant. 101.12 has five significant figures: 1, 0, 1, 1 and 2 Leading zeros are not significant. 0.00052 has two significant figures: 5 and 2 and is equivalent to 5.2x10 -4 and would be valid even if the number of significant figures is restricted to 2. Trailing zeros are significant. 12.2300 has six significant figures: 1, 2, 2, 3, 0 and 0 and would thus be invalid if the number of significant figures is restricted to 4. Note: The number of significant figures andor an interval constraint i.e. minmax values can help a software implementation choosing the best data type to use i.e. ‘float’ or ‘double’, ‘short’, ‘int’ or ‘long’ to store values associated to a given data component. Copyright © 2011 Open Geospatial Consortium 41