AllowedValues Element Requirements Class: Basic Types and Simple Components Schemas Requirements Class

SWE Common Data Model OGC 08-094r1 This element is used to specify numerical constraints for the “Count” and “Quantity” elements and the corresponding range components. The XML snippet below illustrates how to constrain an angular value to the -180180 degrees domain: swe:Quantity definition = http:sweet.jpl.nasa.gov2.0spaceDirection.owlAngle swe:label Planar Angle swe:label swe:uom code = deg swe:constraint swe:AllowedValues swe:interval -180 +180 swe:interval swe:AllowedValues swe:constraint swe:Quantity Several intervals can be specified to generate holes with forbidden values. Using several intervals means that the value is constrained to be within one of the intervals: swe:AllowedValues swe:interval -INF -20 swe:interval swe:interval 20 50 swe:interval swe:interval 60 INF swe:interval swe:AllowedValues Note that the –Infinity and +Infinity are allowed in order to specify unbounded intervals. The above example indicates that the value must be either less than or equal to -20, between 20 and 50 included, or greater than or equal to 60. Intervals specified with this element are always inclusive and should not overlap. Allowed values can also be enumerated as shown in the example below: swe:Count definition = http:www.opengis.netdefpropertyOGC0NumberOfPixels swe:label Image Width swe:label swe:constraint swe:AllowedValues swe:value 256 swe:value swe:value 512 swe:value swe:value 1024 swe:value swe:AllowedValues swe:constraint swe:Count Several allowed intervals and values can also be combined to express a complex constraint even though this is rarely used in practice: swe:AllowedValues swe:value 5 swe:value swe:value 10 swe:value swe:interval 20 30 swe:interval swe:interval 40 60 swe:interval swe:AllowedValues In the above example, the actual value must be 5, or 10, or between 20 and 30 included, or between 40 and 60 included. All numbers used within “interval” and “value” elements shall be expressed in the same unit as the enclosing data component Req 36. Copyright © 2011 Open Geospatial Consortium 87 OGC 08-094r1 SWE Common Data Model The last option to specify a constraint on a decimal number so only applicable to “Quantity” is to limit the number of significant figures: swe:AllowedValues swe:significantFigures 5 swe:significantFigures swe:AllowedValues Constraining a number to 5 significant figures means that a total of only 5 digits are or can be used for the representation of the value. The numbers 1.2345, 5.4823e-3, 0.98655 and 00235 are all composed of 5 significant figures, but 1.23450 and 658970 have six significant figures leading zeros are ignored. When decimal values are encoded with a binary floating point data type rather than text, restricting the number of significant figures also means that the lowest order fractional digits of the mantissa should be ignored even though they may be encoded due to rounding errors.

8.1.17 AllowedTimes Element

The “AllowedTimes” element is the XML schema implementation of the “AllowedTimes” UML class defined in clause 7.2.19. The schema snippet for this element and its corresponding complex type is shown below: element name = AllowedTimes substitutionGroup = swe:AbstractSWE type = swe:AllowedTimesType complexType name = AllowedTimesType complexContent extension base = swe:AbstractSWEType sequence element name = value type = swe:TimePosition minOccurs = maxOccurs = unbounded element name = interval type = swe:TimePair minOccurs = maxOccurs = unbounded element name = significantFigures type = integer minOccurs = sequence extension complexContent complexType This element is used to specify numerical constraints with the “Time” and “TimeRange” elements. It is used in the same way as the “AllowedValues” element in “Quantity” when the temporal value is expressed as a decimal number, but also supports encoding enumerated values and intervals as ISO 8601 date times. The definition of a temporal field with a restriction to a certain period is shown below: swe:Time definition = http:www.opengis.netdefpropertyOGC0SamplingTime swe:label Acquisition Time swe:label swe:uom xlink:href = http:www.opengis.netdefuomISO-86010Gregorian swe:constraint swe:AllowedTimes swe:interval 2009-01-01 INF swe:interval swe:AllowedTimes swe:constraint swe:Time 88 Copyright © 2011 Open Geospatial Consortium SWE Common Data Model OGC 08-094r1 Note that unbounded intervals are also possible when ISO 8601 notation is used. In all other cases mixing decimal and ISO 8601 notation is forbidden. If the “uom” element indicates that ISO 8601 is the unit, then constraints shall be expressed using ISO 8601 notation as well, otherwise constraints shall be expressed with decimal numbers with the scale specified by “uom”. This is enforced by a Schematron pattern Req 36.

8.1.18 Simple Component Groups

Three XML element groups as well as the corresponding property types are defined in the schema in order to simplify their use in external schemas. group name = AnyScalar choice element ref = swe:Boolean element ref = swe:Count element ref = swe:Quantity element ref = swe:Time element ref = swe:Category element ref = swe:Text choice group group name = AnyNumerical choice element ref = swe:Count element ref = swe:Quantity element ref = swe:Time choice group group name = AnyRange choice element ref = swe:QuantityRange element ref = swe:TimeRange element ref = swe:CountRange element ref = swe:CategoryRange choice group The “AnyScalar” group contains all scalar representations, “AnyNumerical” only numerical representations and the “AnyRange” group includes all range components. Copyright © 2011 Open Geospatial Consortium 89