Search in sources :

Example 1 with TimePositionListDocument

use of net.opengis.watermlDr.x20.TimePositionListDocument in project arctic-sea by 52North.

the class WmlTDREncoderv20 method getTimePositionList.

private TimePositionListDocument getTimePositionList(AbstractObservationValue<?> observationValue) throws EncodingException {
    TimePositionListDocument timePositionListDoc = TimePositionListDocument.Factory.newInstance();
    TimePositionListType timePositionList = timePositionListDoc.addNewTimePositionList();
    timePositionList.setId(TIME_POSITION_LIST_ID_PREFIX + observationValue.getObservationID());
    timePositionList.setTimePositionList(getTimeArray((MultiObservationValues<?>) observationValue));
    return timePositionListDoc;
}
Also used : TimePositionListDocument(net.opengis.watermlDr.x20.TimePositionListDocument) MultiObservationValues(org.n52.shetland.ogc.om.MultiObservationValues) TimePositionListType(net.opengis.watermlDr.x20.TimePositionListType)

Example 2 with TimePositionListDocument

use of net.opengis.watermlDr.x20.TimePositionListDocument 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

TimePositionListDocument (net.opengis.watermlDr.x20.TimePositionListDocument)2 TimePositionListType (net.opengis.watermlDr.x20.TimePositionListType)2 MultiObservationValues (org.n52.shetland.ogc.om.MultiObservationValues)1 SingleObservationValue (org.n52.shetland.ogc.om.SingleObservationValue)1