Search in sources :

Example 1 with MeasurementTimeseriesMetadataType

use of net.opengis.waterml.x20.MeasurementTimeseriesMetadataType in project arctic-sea by 52North.

the class WmlTVPEncoderv20 method addTimeseriesMetadata.

private void addTimeseriesMetadata(MeasurementTimeseriesType mtt, String gmlId, TimeseriesMetadata timeseriesMetadata) {
    MeasurementTimeseriesMetadataType mtmt = (MeasurementTimeseriesMetadataType) mtt.addNewMetadata().addNewTimeseriesMetadata().substitute(WaterMLConstants.QN_MEASUREMENT_TIMESERIES_METADATA, MeasurementTimeseriesMetadataType.type);
    createMeasurementTimeseriesMetadataType(mtmt, gmlId);
    if (timeseriesMetadata != null && timeseriesMetadata.getClass().isAssignableFrom(MeasurementTimeseriesMetadata.class)) {
        mtmt.setCumulative(((MeasurementTimeseriesMetadata) timeseriesMetadata).isCumulative());
    }
}
Also used : MeasurementTimeseriesMetadataType(net.opengis.waterml.x20.MeasurementTimeseriesMetadataType) MeasurementTimeseriesMetadata(org.n52.shetland.ogc.om.series.wml.MeasurementTimeseriesMetadata)

Example 2 with MeasurementTimeseriesMetadataType

use of net.opengis.waterml.x20.MeasurementTimeseriesMetadataType in project arctic-sea by 52North.

the class WmlTVPEncoderv20Test method shouldEncodeCumulativeProperty.

@Test
public void shouldEncodeCumulativeProperty() throws EncodingException {
    mv.setMetadata(new Metadata().setTimeseriesmetadata(new MeasurementTimeseriesMetadata().setCumulative(true)));
    XmlObject encodedElement = encoder.encode(mv);
    Assert.assertThat(((MeasurementTimeseriesMetadataType) ((MeasurementTimeseriesDocument) encodedElement).getTimeseries().getMetadata().getTimeseriesMetadata()).getCumulative(), Is.is(true));
}
Also used : DefaultTVPMeasurementMetadata(org.n52.shetland.ogc.om.series.wml.DefaultTVPMeasurementMetadata) DefaultPointMetadata(org.n52.shetland.ogc.om.series.wml.DefaultPointMetadata) Metadata(org.n52.shetland.ogc.om.series.wml.Metadata) MeasurementTimeseriesMetadata(org.n52.shetland.ogc.om.series.wml.MeasurementTimeseriesMetadata) MeasurementTimeseriesMetadata(org.n52.shetland.ogc.om.series.wml.MeasurementTimeseriesMetadata) XmlObject(org.apache.xmlbeans.XmlObject) MeasurementTimeseriesDocument(net.opengis.waterml.x20.MeasurementTimeseriesDocument) Test(org.junit.Test)

Example 3 with MeasurementTimeseriesMetadataType

use of net.opengis.waterml.x20.MeasurementTimeseriesMetadataType in project arctic-sea by 52North.

the class WmlTVPEncoderv20Test method shouldSetDefaultCumulativeProperty.

@Test
public void shouldSetDefaultCumulativeProperty() throws EncodingException {
    XmlObject encodedElement = encoder.encode(mv);
    Assert.assertThat(encodedElement, CoreMatchers.instanceOf(MeasurementTimeseriesDocument.class));
    final MeasurementTimeseriesDocument measurementTimeseriesDocument = (MeasurementTimeseriesDocument) encodedElement;
    Assert.assertThat(measurementTimeseriesDocument.getTimeseries().isSetMetadata(), Is.is(true));
    Assert.assertThat(measurementTimeseriesDocument.getTimeseries().getMetadata().getTimeseriesMetadata(), CoreMatchers.instanceOf(MeasurementTimeseriesMetadataType.class));
    final MeasurementTimeseriesMetadataType measurementTimeseriesMetadataType = (MeasurementTimeseriesMetadataType) measurementTimeseriesDocument.getTimeseries().getMetadata().getTimeseriesMetadata();
    Assert.assertThat(measurementTimeseriesMetadataType.isSetCumulative(), Is.is(true));
    Assert.assertThat(measurementTimeseriesMetadataType.getCumulative(), Is.is(false));
}
Also used : MeasurementTimeseriesMetadataType(net.opengis.waterml.x20.MeasurementTimeseriesMetadataType) XmlObject(org.apache.xmlbeans.XmlObject) MeasurementTimeseriesDocument(net.opengis.waterml.x20.MeasurementTimeseriesDocument) Test(org.junit.Test)

Aggregations

MeasurementTimeseriesDocument (net.opengis.waterml.x20.MeasurementTimeseriesDocument)2 MeasurementTimeseriesMetadataType (net.opengis.waterml.x20.MeasurementTimeseriesMetadataType)2 XmlObject (org.apache.xmlbeans.XmlObject)2 Test (org.junit.Test)2 MeasurementTimeseriesMetadata (org.n52.shetland.ogc.om.series.wml.MeasurementTimeseriesMetadata)2 DefaultPointMetadata (org.n52.shetland.ogc.om.series.wml.DefaultPointMetadata)1 DefaultTVPMeasurementMetadata (org.n52.shetland.ogc.om.series.wml.DefaultTVPMeasurementMetadata)1 Metadata (org.n52.shetland.ogc.om.series.wml.Metadata)1