Search in sources :

Example 16 with MultiObservationValues

use of org.n52.shetland.ogc.om.MultiObservationValues in project arctic-sea by 52North.

the class WmlTDREncoderv20 method getTimePositionList.

/**
 * Create a TimePositionList XML object from time values
 *
 * @param sosObservation
 *            SOS observation
 * @return XML TimePositionList object
 * @throws EncodingException
 *             If an error occurs
 */
private TimePositionListDocument getTimePositionList(OmObservation sosObservation) throws EncodingException {
    TimePositionListDocument timePositionListDoc = TimePositionListDocument.Factory.newInstance();
    TimePositionListType timePositionList = timePositionListDoc.addNewTimePositionList();
    timePositionList.setId(TIME_POSITION_LIST_ID_PREFIX + sosObservation.getObservationID());
    if (sosObservation.getValue() instanceof SingleObservationValue<?>) {
        timePositionList.setTimePositionList(Lists.newArrayList(getTimeString(sosObservation.getValue().getPhenomenonTime())));
    } else if (sosObservation.getValue() instanceof MultiObservationValues<?>) {
        timePositionList.setTimePositionList(getTimeArray((MultiObservationValues<?>) sosObservation.getValue()));
    }
    return timePositionListDoc;
}
Also used : TimePositionListDocument(net.opengis.watermlDr.x20.TimePositionListDocument) SingleObservationValue(org.n52.shetland.ogc.om.SingleObservationValue) TimePositionListType(net.opengis.watermlDr.x20.TimePositionListType)

Aggregations

MultiObservationValues (org.n52.shetland.ogc.om.MultiObservationValues)13 List (java.util.List)10 TVPValue (org.n52.shetland.ogc.om.values.TVPValue)8 SingleObservationValue (org.n52.shetland.ogc.om.SingleObservationValue)7 TimeValuePair (org.n52.shetland.ogc.om.TimeValuePair)7 TimeLocationValueTriple (org.n52.shetland.ogc.om.TimeLocationValueTriple)6 TLVTValue (org.n52.shetland.ogc.om.values.TLVTValue)6 OmObservation (org.n52.shetland.ogc.om.OmObservation)4 QuantityValue (org.n52.shetland.ogc.om.values.QuantityValue)3 MeasureOrNilReasonListType (net.opengis.gml.x32.MeasureOrNilReasonListType)2 QuantityListDocument (net.opengis.gml.x32.QuantityListDocument)2 TVPDefaultMetadataPropertyType (net.opengis.waterml.x20.TVPDefaultMetadataPropertyType)2 MeasurementTimeseriesCoverageType (net.opengis.watermlDr.x20.MeasurementTimeseriesCoverageType)2 MeasurementTimeseriesDomainRangeDocument (net.opengis.watermlDr.x20.MeasurementTimeseriesDomainRangeDocument)2 TimePositionListDocument (net.opengis.watermlDr.x20.TimePositionListDocument)2 TimePositionListType (net.opengis.watermlDr.x20.TimePositionListType)2 OmObservableProperty (org.n52.shetland.ogc.om.OmObservableProperty)2 StreamingValue (org.n52.shetland.ogc.om.StreamingValue)2 CountValue (org.n52.shetland.ogc.om.values.CountValue)2 SweDataArrayValue (org.n52.shetland.ogc.om.values.SweDataArrayValue)2