Search in sources :

Example 66 with OmObservation

use of org.n52.shetland.ogc.om.OmObservation 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

OmObservation (org.n52.shetland.ogc.om.OmObservation)32 XmlObject (org.apache.xmlbeans.XmlObject)17 TimeInstant (org.n52.shetland.ogc.gml.time.TimeInstant)16 Time (org.n52.shetland.ogc.gml.time.Time)15 EncodingException (org.n52.svalbard.encode.exception.EncodingException)14 DateTime (org.joda.time.DateTime)13 TimePeriod (org.n52.shetland.ogc.gml.time.TimePeriod)11 OmObservableProperty (org.n52.shetland.ogc.om.OmObservableProperty)11 OwsExceptionReport (org.n52.shetland.ogc.ows.exception.OwsExceptionReport)10 XmlString (org.apache.xmlbeans.XmlString)9 AbstractFeature (org.n52.shetland.ogc.gml.AbstractFeature)9 CodeWithAuthority (org.n52.shetland.ogc.gml.CodeWithAuthority)9 MultiObservationValues (org.n52.shetland.ogc.om.MultiObservationValues)7 ObservationStream (org.n52.shetland.ogc.om.ObservationStream)7 SingleObservationValue (org.n52.shetland.ogc.om.SingleObservationValue)7 OmObservationConstellation (org.n52.shetland.ogc.om.OmObservationConstellation)6 SweDataArray (org.n52.shetland.ogc.swe.SweDataArray)6 List (java.util.List)5 SamplingFeature (org.n52.shetland.ogc.om.features.samplingFeatures.SamplingFeature)5 QuantityValue (org.n52.shetland.ogc.om.values.QuantityValue)5