Class UVFEncoder

java.lang.Object
org.n52.svalbard.encode.UVFEncoder
All Implemented Interfaces:
Component<EncoderKey>, Keyed<EncoderKey>, ConformanceClass, Encoder<BinaryAttachmentResponse,Object>, ObservationEncoder<BinaryAttachmentResponse,Object>

@Configurable public class UVFEncoder extends Object implements ObservationEncoder<BinaryAttachmentResponse,Object>
The UVFEncoder implements the so called Universal Variable Format. The definitions found on the internet are the following: It is used for exchanging timeseries and looks like the following:
  0: $sb Index-Einheit:
 1: $ib Funktion-Interpretation: Summenlinie
 2: $sb Mess-Groesse: Niederschlag
 3: $sb Mess-Einheit: mm
 4: $sb Mess-Stellennummer: 5242
 5: *Z
 6: Niederschlag: mm             1900 2000
 7: 5242              1231240   1413414     52.52
 8: 73110107301002100636Zeit
 9: 7311010730         0
10: 7311050224         0
11: 7311050240 .30333331
12: 7311050255        .5
13: 7311050414        .5
14: 7311050415 -777
15: 7311050419 -777
16: 7311050420 .80000001
 
The Lines 0 to 8 specify the header of the dataset. Hereby, the lines 0 to 4 provide optional metadata. The lines 5 to 8 are mandatory and are referenced in the specification by "Zeile 1,2,3,4". Line 14 and 15 show the handling of gaps or no data values. They are encoded with -777. Gaps are defined by two values: one for the start and one for the end of the gap. The following assumptions/constraints are implemented:
  • Only ONE timeseries will be encoded. Hence, the UVFRequestModifier ensures, that each request for the UVF contains ONE observed property, ONE feature of interest, and ONE procedure.
  • Only observations of type Measurement and Count are supported.
  • The encoder does not check for gaps and encodes only start and end. This MUST be done before inserting the data in the SOS database.
  • Identifiers are shortened via String.substring(int, int) to the length of UVFConstants.MAX_IDENTIFIER_LENGTH (15) starting from the end of the given identifier.
  • Values (e.g. measurements and coordinates) are shortened via String.substring(int, int) to the length of UVFConstants.MAX_VALUE_LENGTH (10) starting form the beginning of the String representation of the value. No rounding is performed.
  • The UVF requires that all coordinates are in Gauß Krüger, hence a coordinate transformation is performed before the response is encoded. This requires that the EPSG code of the best matching GK band is given. When not present in the request, a default value is used. This value can be specified using the admin WebUI of the SOS. Currently the following EPSG codes are allowed (see UVFConstants.ALLOWED_CRS):
    • 31466
    • 31467
    • 31468
    • 31469