use of org.n52.shetland.ogc.gml.time.IndeterminateValue in project arctic-sea by 52North.
the class GmlDecoderv311 method parseTimePosition.
private TimeInstant parseTimePosition(TimePositionType xbTimePosition) throws DecodingException {
TimeInstant ti = new TimeInstant();
String timeString = xbTimePosition.getStringValue();
if (timeString != null && !timeString.isEmpty()) {
try {
// TODO better differnetiate between ISO8601 and an
// indeterminate value
DateTime dateTime = DateTimeHelper.parseIsoString2DateTime(timeString);
ti.setValue(dateTime);
ti.setRequestedTimeLength(DateTimeHelper.getTimeLengthBeforeTimeZone(timeString));
} catch (DateTimeParseException ex) {
ti.setIndeterminateValue(new IndeterminateValue(timeString));
}
}
if (xbTimePosition.getIndeterminatePosition() != null) {
ti.setIndeterminateValue(new IndeterminateValue(xbTimePosition.getIndeterminatePosition().toString()));
}
return ti;
}
use of org.n52.shetland.ogc.gml.time.IndeterminateValue in project arctic-sea by 52North.
the class GmlDecoderv321 method parseTimePosition.
private TimeInstant parseTimePosition(TimePositionType xbTimePosition) throws DecodingException {
TimeInstant ti = new TimeInstant();
String timeString = xbTimePosition.getStringValue();
if (timeString != null && !timeString.isEmpty()) {
try {
// TODO better differentiate between ISO8601 and indeterminate
// value
ti.setValue(DateTimeHelper.parseIsoString2DateTime(timeString));
ti.setRequestedTimeLength(DateTimeHelper.getTimeLengthBeforeTimeZone(timeString));
} catch (DateTimeParseException ex) {
ti.setIndeterminateValue(new IndeterminateValue(timeString));
}
}
if (xbTimePosition.isSetIndeterminatePosition()) {
ti.setIndeterminateValue(new IndeterminateValue(xbTimePosition.getIndeterminatePosition().toString()));
}
return ti;
}
Aggregations