use of org.n52.shetland.ogc.om.values.TLVTValue in project arctic-sea by 52North.
the class TrajectoryObservationTypeEncoderTest method getCountObservation.
private OmObservation getCountObservation() throws EncodingException, ParseException, DecodingException, XmlException, IOException {
MultiObservationValues<List<TimeLocationValueTriple>> multiObservationValues = new MultiObservationValues<List<TimeLocationValueTriple>>();
TLVTValue tlvtValue = new TLVTValue();
tlvtValue.addValue(getTimeLocationValueTriple(new CountValue(15)));
tlvtValue.addValue(getTimeLocationValueTriple(new CountValue(16)));
tlvtValue.addValue(getTimeLocationValueTriple(new CountValue(17)));
tlvtValue.addValue(getTimeLocationValueTriple(new CountValue(18)));
multiObservationValues.setValue(tlvtValue);
OmObservation observation = createObservation();
observation.setValue(multiObservationValues);
return observation;
}
use of org.n52.shetland.ogc.om.values.TLVTValue in project arctic-sea by 52North.
the class TrajectoryObservation method mergeValues.
protected boolean mergeValues(ObservationValue<?> observationValue) {
if (observationValue.getValue() instanceof TLVTValue) {
TLVTValue tlvtValue = (TLVTValue) observationValue.getValue();
List<TimeLocationValueTriple> valuesToMerge = tlvtValue.getValue();
// List<TimeLocationValueTriple> valuesToMerge =
// (List<TimeLocationValueTriple>)((TLVTValue)observationValue.getValue()).getValue();
((TLVTValue) getValue().getValue()).addValues(valuesToMerge);
checkForFeature(valuesToMerge);
return true;
} else {
return super.mergeValues(observationValue);
}
}
use of org.n52.shetland.ogc.om.values.TLVTValue in project arctic-sea by 52North.
the class TrajectoryObservationTypeEncoderTest method getCategoricalObservation.
private OmObservation getCategoricalObservation() throws EncodingException, ParseException, DecodingException, XmlException, IOException {
MultiObservationValues<List<TimeLocationValueTriple>> multiObservationValues = new MultiObservationValues<List<TimeLocationValueTriple>>();
TLVTValue tlvtValue = new TLVTValue();
tlvtValue.addValue(getTimeLocationValueTriple(new CategoryValue("test_1", "test_voc")));
tlvtValue.addValue(getTimeLocationValueTriple(new CategoryValue("test_1", "test_voc")));
tlvtValue.addValue(getTimeLocationValueTriple(new CategoryValue("test_3", "test_voc")));
tlvtValue.addValue(getTimeLocationValueTriple(new CategoryValue("test_4", "test_voc")));
multiObservationValues.setValue(tlvtValue);
OmObservation observation = createObservation();
observation.setValue(multiObservationValues);
return observation;
}
Aggregations