Search in sources :

Example 6 with TLVTValue

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;
}
Also used : CountValue(org.n52.shetland.ogc.om.values.CountValue) OmObservation(org.n52.shetland.ogc.om.OmObservation) List(java.util.List) TLVTValue(org.n52.shetland.ogc.om.values.TLVTValue) MultiObservationValues(org.n52.shetland.ogc.om.MultiObservationValues) TimeLocationValueTriple(org.n52.shetland.ogc.om.TimeLocationValueTriple)

Example 7 with TLVTValue

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);
    }
}
Also used : TLVTValue(org.n52.shetland.ogc.om.values.TLVTValue) TimeLocationValueTriple(org.n52.shetland.ogc.om.TimeLocationValueTriple)

Example 8 with TLVTValue

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;
}
Also used : OmObservation(org.n52.shetland.ogc.om.OmObservation) CategoryValue(org.n52.shetland.ogc.om.values.CategoryValue) List(java.util.List) TLVTValue(org.n52.shetland.ogc.om.values.TLVTValue) MultiObservationValues(org.n52.shetland.ogc.om.MultiObservationValues) TimeLocationValueTriple(org.n52.shetland.ogc.om.TimeLocationValueTriple)

Aggregations

TimeLocationValueTriple (org.n52.shetland.ogc.om.TimeLocationValueTriple)8 TLVTValue (org.n52.shetland.ogc.om.values.TLVTValue)8 List (java.util.List)6 MultiObservationValues (org.n52.shetland.ogc.om.MultiObservationValues)6 OmObservation (org.n52.shetland.ogc.om.OmObservation)3 TVPDefaultMetadataPropertyType (net.opengis.waterml.x20.TVPDefaultMetadataPropertyType)2 SingleObservationValue (org.n52.shetland.ogc.om.SingleObservationValue)2 CategoricalTimeseriesDocument (net.opengis.waterml.x20.CategoricalTimeseriesDocument)1 CategoricalTimeseriesType (net.opengis.waterml.x20.CategoricalTimeseriesType)1 DefaultCategoricalTVPMetadataType (net.opengis.waterml.x20.DefaultCategoricalTVPMetadataType)1 DefaultTVPCategoricalMetadataDocument (net.opengis.waterml.x20.DefaultTVPCategoricalMetadataDocument)1 DefaultTVPMeasurementMetadataDocument (net.opengis.waterml.x20.DefaultTVPMeasurementMetadataDocument)1 MeasurementTimeseriesDocument (net.opengis.waterml.x20.MeasurementTimeseriesDocument)1 MeasurementTimeseriesType (net.opengis.waterml.x20.MeasurementTimeseriesType)1 TVPMeasurementMetadataType (net.opengis.waterml.x20.TVPMeasurementMetadataType)1 Geometry (org.locationtech.jts.geom.Geometry)1 AbstractObservationValue (org.n52.shetland.ogc.om.AbstractObservationValue)1 StreamingValue (org.n52.shetland.ogc.om.StreamingValue)1 AbstractSamplingFeature (org.n52.shetland.ogc.om.features.samplingFeatures.AbstractSamplingFeature)1 CategoryValue (org.n52.shetland.ogc.om.values.CategoryValue)1