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;
}
Aggregations