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