Search in sources :

Example 1 with GDurationBuilder

use of org.apache.xmlbeans.GDurationBuilder in project gravitee-api-management by gravitee-io.

the class SampleXmlUtil method formatDuration.

private String formatDuration(SchemaType sType) {
    XmlDuration d = (XmlDuration) sType.getFacet(SchemaType.FACET_MIN_INCLUSIVE);
    GDuration minInclusive = null;
    if (d != null)
        minInclusive = d.getGDurationValue();
    d = (XmlDuration) sType.getFacet(SchemaType.FACET_MAX_INCLUSIVE);
    GDuration maxInclusive = null;
    if (d != null)
        maxInclusive = d.getGDurationValue();
    d = (XmlDuration) sType.getFacet(SchemaType.FACET_MIN_EXCLUSIVE);
    GDuration minExclusive = null;
    if (d != null)
        minExclusive = d.getGDurationValue();
    d = (XmlDuration) sType.getFacet(SchemaType.FACET_MAX_EXCLUSIVE);
    GDuration maxExclusive = null;
    if (d != null)
        maxExclusive = d.getGDurationValue();
    GDurationBuilder gdurb = new GDurationBuilder();
    BigInteger min, max;
    gdurb.setSecond(pick(800000));
    gdurb.setMonth(pick(20));
    // Fractions
    if (minInclusive != null) {
        if (gdurb.getYear() < minInclusive.getYear())
            gdurb.setYear(minInclusive.getYear());
        if (gdurb.getMonth() < minInclusive.getMonth())
            gdurb.setMonth(minInclusive.getMonth());
        if (gdurb.getDay() < minInclusive.getDay())
            gdurb.setDay(minInclusive.getDay());
        if (gdurb.getHour() < minInclusive.getHour())
            gdurb.setHour(minInclusive.getHour());
        if (gdurb.getMinute() < minInclusive.getMinute())
            gdurb.setMinute(minInclusive.getMinute());
        if (gdurb.getSecond() < minInclusive.getSecond())
            gdurb.setSecond(minInclusive.getSecond());
        if (gdurb.getFraction().compareTo(minInclusive.getFraction()) < 0)
            gdurb.setFraction(minInclusive.getFraction());
    }
    if (maxInclusive != null) {
        if (gdurb.getYear() > maxInclusive.getYear())
            gdurb.setYear(maxInclusive.getYear());
        if (gdurb.getMonth() > maxInclusive.getMonth())
            gdurb.setMonth(maxInclusive.getMonth());
        if (gdurb.getDay() > maxInclusive.getDay())
            gdurb.setDay(maxInclusive.getDay());
        if (gdurb.getHour() > maxInclusive.getHour())
            gdurb.setHour(maxInclusive.getHour());
        if (gdurb.getMinute() > maxInclusive.getMinute())
            gdurb.setMinute(maxInclusive.getMinute());
        if (gdurb.getSecond() > maxInclusive.getSecond())
            gdurb.setSecond(maxInclusive.getSecond());
        if (gdurb.getFraction().compareTo(maxInclusive.getFraction()) > 0)
            gdurb.setFraction(maxInclusive.getFraction());
    }
    if (minExclusive != null) {
        if (gdurb.getYear() <= minExclusive.getYear())
            gdurb.setYear(minExclusive.getYear() + 1);
        if (gdurb.getMonth() <= minExclusive.getMonth())
            gdurb.setMonth(minExclusive.getMonth() + 1);
        if (gdurb.getDay() <= minExclusive.getDay())
            gdurb.setDay(minExclusive.getDay() + 1);
        if (gdurb.getHour() <= minExclusive.getHour())
            gdurb.setHour(minExclusive.getHour() + 1);
        if (gdurb.getMinute() <= minExclusive.getMinute())
            gdurb.setMinute(minExclusive.getMinute() + 1);
        if (gdurb.getSecond() <= minExclusive.getSecond())
            gdurb.setSecond(minExclusive.getSecond() + 1);
        if (gdurb.getFraction().compareTo(minExclusive.getFraction()) <= 0)
            gdurb.setFraction(minExclusive.getFraction().add(new BigDecimal(0.001)));
    }
    if (maxExclusive != null) {
        if (gdurb.getYear() > maxExclusive.getYear())
            gdurb.setYear(maxExclusive.getYear());
        if (gdurb.getMonth() > maxExclusive.getMonth())
            gdurb.setMonth(maxExclusive.getMonth());
        if (gdurb.getDay() > maxExclusive.getDay())
            gdurb.setDay(maxExclusive.getDay());
        if (gdurb.getHour() > maxExclusive.getHour())
            gdurb.setHour(maxExclusive.getHour());
        if (gdurb.getMinute() > maxExclusive.getMinute())
            gdurb.setMinute(maxExclusive.getMinute());
        if (gdurb.getSecond() > maxExclusive.getSecond())
            gdurb.setSecond(maxExclusive.getSecond());
        if (gdurb.getFraction().compareTo(maxExclusive.getFraction()) > 0)
            gdurb.setFraction(maxExclusive.getFraction());
    }
    gdurb.normalize();
    return gdurb.toString();
}
Also used : GDuration(org.apache.xmlbeans.GDuration) BigInteger(java.math.BigInteger) XmlDuration(org.apache.xmlbeans.XmlDuration) GDurationBuilder(org.apache.xmlbeans.GDurationBuilder) BigDecimal(java.math.BigDecimal)

Example 2 with GDurationBuilder

use of org.apache.xmlbeans.GDurationBuilder in project convertigo by convertigo.

the class SampleXmlUtil method formatDuration.

private String formatDuration(SchemaType sType) {
    XmlDuration d = (XmlDuration) sType.getFacet(SchemaType.FACET_MIN_INCLUSIVE);
    GDuration minInclusive = null;
    if (d != null)
        minInclusive = d.getGDurationValue();
    d = (XmlDuration) sType.getFacet(SchemaType.FACET_MAX_INCLUSIVE);
    GDuration maxInclusive = null;
    if (d != null)
        maxInclusive = d.getGDurationValue();
    d = (XmlDuration) sType.getFacet(SchemaType.FACET_MIN_EXCLUSIVE);
    GDuration minExclusive = null;
    if (d != null)
        minExclusive = d.getGDurationValue();
    d = (XmlDuration) sType.getFacet(SchemaType.FACET_MAX_EXCLUSIVE);
    GDuration maxExclusive = null;
    if (d != null)
        maxExclusive = d.getGDurationValue();
    GDurationBuilder gdurb = new GDurationBuilder();
    @SuppressWarnings("unused") BigInteger min, max;
    gdurb.setSecond(pick(800000));
    gdurb.setMonth(pick(20));
    // Fractions
    if (minInclusive != null) {
        if (gdurb.getYear() < minInclusive.getYear())
            gdurb.setYear(minInclusive.getYear());
        if (gdurb.getMonth() < minInclusive.getMonth())
            gdurb.setMonth(minInclusive.getMonth());
        if (gdurb.getDay() < minInclusive.getDay())
            gdurb.setDay(minInclusive.getDay());
        if (gdurb.getHour() < minInclusive.getHour())
            gdurb.setHour(minInclusive.getHour());
        if (gdurb.getMinute() < minInclusive.getMinute())
            gdurb.setMinute(minInclusive.getMinute());
        if (gdurb.getSecond() < minInclusive.getSecond())
            gdurb.setSecond(minInclusive.getSecond());
        if (gdurb.getFraction().compareTo(minInclusive.getFraction()) < 0)
            gdurb.setFraction(minInclusive.getFraction());
    }
    if (maxInclusive != null) {
        if (gdurb.getYear() > maxInclusive.getYear())
            gdurb.setYear(maxInclusive.getYear());
        if (gdurb.getMonth() > maxInclusive.getMonth())
            gdurb.setMonth(maxInclusive.getMonth());
        if (gdurb.getDay() > maxInclusive.getDay())
            gdurb.setDay(maxInclusive.getDay());
        if (gdurb.getHour() > maxInclusive.getHour())
            gdurb.setHour(maxInclusive.getHour());
        if (gdurb.getMinute() > maxInclusive.getMinute())
            gdurb.setMinute(maxInclusive.getMinute());
        if (gdurb.getSecond() > maxInclusive.getSecond())
            gdurb.setSecond(maxInclusive.getSecond());
        if (gdurb.getFraction().compareTo(maxInclusive.getFraction()) > 0)
            gdurb.setFraction(maxInclusive.getFraction());
    }
    if (minExclusive != null) {
        if (gdurb.getYear() <= minExclusive.getYear())
            gdurb.setYear(minExclusive.getYear() + 1);
        if (gdurb.getMonth() <= minExclusive.getMonth())
            gdurb.setMonth(minExclusive.getMonth() + 1);
        if (gdurb.getDay() <= minExclusive.getDay())
            gdurb.setDay(minExclusive.getDay() + 1);
        if (gdurb.getHour() <= minExclusive.getHour())
            gdurb.setHour(minExclusive.getHour() + 1);
        if (gdurb.getMinute() <= minExclusive.getMinute())
            gdurb.setMinute(minExclusive.getMinute() + 1);
        if (gdurb.getSecond() <= minExclusive.getSecond())
            gdurb.setSecond(minExclusive.getSecond() + 1);
        if (gdurb.getFraction().compareTo(minExclusive.getFraction()) <= 0)
            gdurb.setFraction(minExclusive.getFraction().add(new BigDecimal(0.001)));
    }
    if (maxExclusive != null) {
        if (gdurb.getYear() > maxExclusive.getYear())
            gdurb.setYear(maxExclusive.getYear());
        if (gdurb.getMonth() > maxExclusive.getMonth())
            gdurb.setMonth(maxExclusive.getMonth());
        if (gdurb.getDay() > maxExclusive.getDay())
            gdurb.setDay(maxExclusive.getDay());
        if (gdurb.getHour() > maxExclusive.getHour())
            gdurb.setHour(maxExclusive.getHour());
        if (gdurb.getMinute() > maxExclusive.getMinute())
            gdurb.setMinute(maxExclusive.getMinute());
        if (gdurb.getSecond() > maxExclusive.getSecond())
            gdurb.setSecond(maxExclusive.getSecond());
        if (gdurb.getFraction().compareTo(maxExclusive.getFraction()) > 0)
            gdurb.setFraction(maxExclusive.getFraction());
    }
    gdurb.normalize();
    return gdurb.toString();
}
Also used : GDuration(org.apache.xmlbeans.GDuration) BigInteger(java.math.BigInteger) XmlDuration(org.apache.xmlbeans.XmlDuration) GDurationBuilder(org.apache.xmlbeans.GDurationBuilder) BigDecimal(java.math.BigDecimal)

Example 3 with GDurationBuilder

use of org.apache.xmlbeans.GDurationBuilder in project arctic-sea by 52North.

the class WmlTVPEncoderv20 method createMeasurementTimeseries.

/**
 * Create a XML MeasurementTimeseries object from SOS observation for
 * om:result
 *
 * @param sosObservation
 *            SOS observation
 *
 * @return XML MeasurementTimeseries object
 * @throws EncodingException
 *
 * @throws CodedException
 *             if the encoding fails
 */
private XmlObject createMeasurementTimeseries(OmObservation sosObservation) throws OwsExceptionReport, EncodingException {
    MeasurementTimeseriesDocument measurementTimeseriesDoc = MeasurementTimeseriesDocument.Factory.newInstance();
    MeasurementTimeseriesType measurementTimeseries = measurementTimeseriesDoc.addNewMeasurementTimeseries();
    measurementTimeseries.setId(TIMESERIES_ID_PREFIX + sosObservation.getObservationID());
    // Default value
    TimeseriesMetadata timeseriesMetadata = new MeasurementTimeseriesMetadata().setCumulative(false);
    if (sosObservation.isSetValue() && sosObservation.getValue().isSetValue() && sosObservation.getValue().getValue().getClass().isAssignableFrom(TVPValue.class) && sosObservation.getObservationConstellation().isSetMetadata() && sosObservation.getObservationConstellation().getMetadata().isSetTimeseriesMetadata()) {
        timeseriesMetadata = sosObservation.getObservationConstellation().getMetadata().getTimeseriesmetadata();
    }
    addTimeseriesMetadata(measurementTimeseries, sosObservation.getPhenomenonTime().getGmlId(), timeseriesMetadata);
    TVPDefaultMetadataPropertyType xbMetaComponent = measurementTimeseries.addNewDefaultPointMetadata();
    DefaultTVPMeasurementMetadataDocument xbDefMeasureMetaComponent = DefaultTVPMeasurementMetadataDocument.Factory.newInstance();
    TVPMeasurementMetadataType defaultTVPMeasurementMetadata = xbDefMeasureMetaComponent.addNewDefaultTVPMeasurementMetadata();
    // Default value
    InterpolationType interpolationType = InterpolationType.Continuous;
    if (sosObservation.isSetValue() && sosObservation.getValue().isSetValue() && sosObservation.getObservationConstellation().isSetDefaultPointMetadata() && sosObservation.getObservationConstellation().getDefaultPointMetadata().isSetDefaultTVPMeasurementMetadata() && sosObservation.getObservationConstellation().getDefaultPointMetadata().getDefaultTVPMeasurementMetadata().isSetInterpolationType()) {
        interpolationType = (InterpolationType) sosObservation.getObservationConstellation().getDefaultPointMetadata().getDefaultTVPMeasurementMetadata().getInterpolationtype();
    }
    defaultTVPMeasurementMetadata.addNewInterpolationType().setHref(interpolationType.getIdentifier());
    xbDefMeasureMetaComponent.getDefaultTVPMeasurementMetadata().getInterpolationType().setTitle(interpolationType.getTitle());
    // set aggregationDuration
    if (sosObservation.getObservationConstellation().getDefaultPointMetadata().getDefaultTVPMeasurementMetadata().isSetAggregationDuration()) {
        GDurationBuilder gDurationBuilder = new GDurationBuilder(sosObservation.getObservationConstellation().getDefaultPointMetadata().getDefaultTVPMeasurementMetadata().getAggregationDuration());
        xbDefMeasureMetaComponent.getDefaultTVPMeasurementMetadata().setAggregationDuration(gDurationBuilder.toGDuration());
    }
    String unit = addValues(measurementTimeseries, sosObservation.getValue());
    // set uom
    if (unit != null && !unit.isEmpty()) {
        defaultTVPMeasurementMetadata.addNewUom().setCode(unit);
    } else {
        OmObservableProperty observableProperty = (OmObservableProperty) sosObservation.getObservationConstellation().getObservableProperty();
        if (observableProperty.isSetUnit()) {
            defaultTVPMeasurementMetadata.addNewUom().setCode(observableProperty.getUnit());
        }
    }
    xbMetaComponent.set(xbDefMeasureMetaComponent);
    return measurementTimeseriesDoc;
}
Also used : MeasurementTimeseriesMetadata(org.n52.shetland.ogc.om.series.MeasurementTimeseriesMetadata) TimeseriesMetadata(org.n52.shetland.ogc.om.series.TimeseriesMetadata) MeasurementTimeseriesType(net.opengis.waterml.x20.MeasurementTimeseriesType) TVPValue(org.n52.shetland.ogc.om.values.TVPValue) TVPDefaultMetadataPropertyType(net.opengis.waterml.x20.TVPDefaultMetadataPropertyType) MeasurementTimeseriesMetadata(org.n52.shetland.ogc.om.series.MeasurementTimeseriesMetadata) TVPMeasurementMetadataType(net.opengis.waterml.x20.TVPMeasurementMetadataType) DefaultTVPMeasurementMetadataDocument(net.opengis.waterml.x20.DefaultTVPMeasurementMetadataDocument) InterpolationType(org.n52.shetland.ogc.om.series.wml.WaterMLConstants.InterpolationType) GDurationBuilder(org.apache.xmlbeans.GDurationBuilder) MeasurementTimeseriesDocument(net.opengis.waterml.x20.MeasurementTimeseriesDocument) OmObservableProperty(org.n52.shetland.ogc.om.OmObservableProperty)

Example 4 with GDurationBuilder

use of org.apache.xmlbeans.GDurationBuilder in project gravitee-management-rest-api by gravitee-io.

the class SampleXmlUtil method formatDuration.

private String formatDuration(SchemaType sType) {
    XmlDuration d = (XmlDuration) sType.getFacet(SchemaType.FACET_MIN_INCLUSIVE);
    GDuration minInclusive = null;
    if (d != null)
        minInclusive = d.getGDurationValue();
    d = (XmlDuration) sType.getFacet(SchemaType.FACET_MAX_INCLUSIVE);
    GDuration maxInclusive = null;
    if (d != null)
        maxInclusive = d.getGDurationValue();
    d = (XmlDuration) sType.getFacet(SchemaType.FACET_MIN_EXCLUSIVE);
    GDuration minExclusive = null;
    if (d != null)
        minExclusive = d.getGDurationValue();
    d = (XmlDuration) sType.getFacet(SchemaType.FACET_MAX_EXCLUSIVE);
    GDuration maxExclusive = null;
    if (d != null)
        maxExclusive = d.getGDurationValue();
    GDurationBuilder gdurb = new GDurationBuilder();
    BigInteger min, max;
    gdurb.setSecond(pick(800000));
    gdurb.setMonth(pick(20));
    // Fractions
    if (minInclusive != null) {
        if (gdurb.getYear() < minInclusive.getYear())
            gdurb.setYear(minInclusive.getYear());
        if (gdurb.getMonth() < minInclusive.getMonth())
            gdurb.setMonth(minInclusive.getMonth());
        if (gdurb.getDay() < minInclusive.getDay())
            gdurb.setDay(minInclusive.getDay());
        if (gdurb.getHour() < minInclusive.getHour())
            gdurb.setHour(minInclusive.getHour());
        if (gdurb.getMinute() < minInclusive.getMinute())
            gdurb.setMinute(minInclusive.getMinute());
        if (gdurb.getSecond() < minInclusive.getSecond())
            gdurb.setSecond(minInclusive.getSecond());
        if (gdurb.getFraction().compareTo(minInclusive.getFraction()) < 0)
            gdurb.setFraction(minInclusive.getFraction());
    }
    if (maxInclusive != null) {
        if (gdurb.getYear() > maxInclusive.getYear())
            gdurb.setYear(maxInclusive.getYear());
        if (gdurb.getMonth() > maxInclusive.getMonth())
            gdurb.setMonth(maxInclusive.getMonth());
        if (gdurb.getDay() > maxInclusive.getDay())
            gdurb.setDay(maxInclusive.getDay());
        if (gdurb.getHour() > maxInclusive.getHour())
            gdurb.setHour(maxInclusive.getHour());
        if (gdurb.getMinute() > maxInclusive.getMinute())
            gdurb.setMinute(maxInclusive.getMinute());
        if (gdurb.getSecond() > maxInclusive.getSecond())
            gdurb.setSecond(maxInclusive.getSecond());
        if (gdurb.getFraction().compareTo(maxInclusive.getFraction()) > 0)
            gdurb.setFraction(maxInclusive.getFraction());
    }
    if (minExclusive != null) {
        if (gdurb.getYear() <= minExclusive.getYear())
            gdurb.setYear(minExclusive.getYear() + 1);
        if (gdurb.getMonth() <= minExclusive.getMonth())
            gdurb.setMonth(minExclusive.getMonth() + 1);
        if (gdurb.getDay() <= minExclusive.getDay())
            gdurb.setDay(minExclusive.getDay() + 1);
        if (gdurb.getHour() <= minExclusive.getHour())
            gdurb.setHour(minExclusive.getHour() + 1);
        if (gdurb.getMinute() <= minExclusive.getMinute())
            gdurb.setMinute(minExclusive.getMinute() + 1);
        if (gdurb.getSecond() <= minExclusive.getSecond())
            gdurb.setSecond(minExclusive.getSecond() + 1);
        if (gdurb.getFraction().compareTo(minExclusive.getFraction()) <= 0)
            gdurb.setFraction(minExclusive.getFraction().add(new BigDecimal(0.001)));
    }
    if (maxExclusive != null) {
        if (gdurb.getYear() > maxExclusive.getYear())
            gdurb.setYear(maxExclusive.getYear());
        if (gdurb.getMonth() > maxExclusive.getMonth())
            gdurb.setMonth(maxExclusive.getMonth());
        if (gdurb.getDay() > maxExclusive.getDay())
            gdurb.setDay(maxExclusive.getDay());
        if (gdurb.getHour() > maxExclusive.getHour())
            gdurb.setHour(maxExclusive.getHour());
        if (gdurb.getMinute() > maxExclusive.getMinute())
            gdurb.setMinute(maxExclusive.getMinute());
        if (gdurb.getSecond() > maxExclusive.getSecond())
            gdurb.setSecond(maxExclusive.getSecond());
        if (gdurb.getFraction().compareTo(maxExclusive.getFraction()) > 0)
            gdurb.setFraction(maxExclusive.getFraction());
    }
    gdurb.normalize();
    return gdurb.toString();
}
Also used : GDuration(org.apache.xmlbeans.GDuration) BigInteger(java.math.BigInteger) XmlDuration(org.apache.xmlbeans.XmlDuration) GDurationBuilder(org.apache.xmlbeans.GDurationBuilder) BigDecimal(java.math.BigDecimal)

Example 5 with GDurationBuilder

use of org.apache.xmlbeans.GDurationBuilder in project arctic-sea by 52North.

the class TsmlTVPEncoderv10 method createMeasurementTimeseries.

/**
 * Create a XML MeasurementTimeseries object from SOS observation for
 * om:result
 *
 * @param sosObservation
 *            SOS observation
 *
 * @return XML MeasurementTimeseries object
 * @throws EncodingException
 *
 * @throws CodedException
 *             if the encoding fails
 */
private XmlObject createMeasurementTimeseries(OmObservation sosObservation) throws OwsExceptionReport, EncodingException {
    TimeseriesTVPDocument measurementTimeseriesDoc = TimeseriesTVPDocument.Factory.newInstance();
    TimeseriesTVPType measurementTimeseries = measurementTimeseriesDoc.addNewTimeseriesTVP();
    ((AbstractGMLType) measurementTimeseries).setId(TIMESERIES_ID_PREFIX + sosObservation.getObservationID());
    // Default value
    TimeseriesMetadata timeseriesMetadata = new MeasurementTimeseriesMetadata().setCumulative(false);
    if (sosObservation.isSetValue() && sosObservation.getValue().isSetValue() && sosObservation.getValue().getValue().getClass().isAssignableFrom(TVPValue.class) && sosObservation.getObservationConstellation().isSetMetadata() && sosObservation.getObservationConstellation().getMetadata().isSetTimeseriesMetadata()) {
        timeseriesMetadata = sosObservation.getObservationConstellation().getMetadata().getTimeseriesmetadata();
    }
    addTimeseriesMetadata(measurementTimeseries, sosObservation.getPhenomenonTime().getGmlId(), timeseriesMetadata);
    TimeseriesTVPType.DefaultPointMetadata xbMetaComponent = measurementTimeseries.addNewDefaultPointMetadata();
    PointMetadataDocument xbDefMeasureMetaComponent = PointMetadataDocument.Factory.newInstance();
    PointMetadataType defaultTVPMeasurementMetadata = xbDefMeasureMetaComponent.addNewPointMetadata();
    // Default value
    InterpolationType interpolationType = InterpolationType.Continuous;
    if (sosObservation.isSetValue() && sosObservation.getValue().isSetValue() && sosObservation.getValue().getValue().getClass().isAssignableFrom(TVPValue.class) && sosObservation.getObservationConstellation().isSetDefaultPointMetadata() && sosObservation.getObservationConstellation().getDefaultPointMetadata().isSetDefaultTVPMeasurementMetadata() && sosObservation.getObservationConstellation().getDefaultPointMetadata().getDefaultTVPMeasurementMetadata().isSetInterpolationType()) {
        interpolationType = (InterpolationType) sosObservation.getObservationConstellation().getDefaultPointMetadata().getDefaultTVPMeasurementMetadata().getInterpolationtype();
    }
    defaultTVPMeasurementMetadata.addNewInterpolationType().setHref(interpolationType.getIdentifier());
    xbDefMeasureMetaComponent.getPointMetadata().getInterpolationType().setTitle(interpolationType.getTitle());
    // set aggregationDuration
    if (sosObservation.getObservationConstellation().getDefaultPointMetadata().getDefaultTVPMeasurementMetadata().isSetAggregationDuration()) {
        GDurationBuilder gDurationBuilder = new GDurationBuilder(sosObservation.getObservationConstellation().getDefaultPointMetadata().getDefaultTVPMeasurementMetadata().getAggregationDuration());
        xbDefMeasureMetaComponent.getPointMetadata().setAggregationDuration(gDurationBuilder.toGDuration());
    }
    String unit = addValues(measurementTimeseries, sosObservation.getValue());
    // set uom
    if (unit != null && !unit.isEmpty()) {
        defaultTVPMeasurementMetadata.addNewUom().setCode(unit);
    } else {
        OmObservableProperty observableProperty = (OmObservableProperty) sosObservation.getObservationConstellation().getObservableProperty();
        if (observableProperty.isSetUnit()) {
            defaultTVPMeasurementMetadata.addNewUom().setCode(observableProperty.getUnit());
        }
    }
    xbMetaComponent.set(xbDefMeasureMetaComponent);
    return measurementTimeseriesDoc;
}
Also used : MeasurementTimeseriesMetadata(org.n52.shetland.ogc.om.series.MeasurementTimeseriesMetadata) TimeseriesMetadata(org.n52.shetland.ogc.om.series.TimeseriesMetadata) TVPValue(org.n52.shetland.ogc.om.values.TVPValue) TimeseriesTVPDocument(net.opengis.tsml.x10.TimeseriesTVPDocument) AbstractGMLType(net.opengis.gml.x32.AbstractGMLType) MeasurementTimeseriesMetadata(org.n52.shetland.ogc.om.series.MeasurementTimeseriesMetadata) PointMetadataDocument(net.opengis.tsml.x10.PointMetadataDocument) GDurationBuilder(org.apache.xmlbeans.GDurationBuilder) TimeseriesTVPType(net.opengis.tsml.x10.TimeseriesTVPType) PointMetadataType(net.opengis.tsml.x10.PointMetadataType) InterpolationType(org.n52.shetland.ogc.om.series.tsml.TimeseriesMLConstants.InterpolationType) OmObservableProperty(org.n52.shetland.ogc.om.OmObservableProperty)

Aggregations

GDurationBuilder (org.apache.xmlbeans.GDurationBuilder)5 BigDecimal (java.math.BigDecimal)3 BigInteger (java.math.BigInteger)3 GDuration (org.apache.xmlbeans.GDuration)3 XmlDuration (org.apache.xmlbeans.XmlDuration)3 OmObservableProperty (org.n52.shetland.ogc.om.OmObservableProperty)2 MeasurementTimeseriesMetadata (org.n52.shetland.ogc.om.series.MeasurementTimeseriesMetadata)2 TimeseriesMetadata (org.n52.shetland.ogc.om.series.TimeseriesMetadata)2 TVPValue (org.n52.shetland.ogc.om.values.TVPValue)2 AbstractGMLType (net.opengis.gml.x32.AbstractGMLType)1 PointMetadataDocument (net.opengis.tsml.x10.PointMetadataDocument)1 PointMetadataType (net.opengis.tsml.x10.PointMetadataType)1 TimeseriesTVPDocument (net.opengis.tsml.x10.TimeseriesTVPDocument)1 TimeseriesTVPType (net.opengis.tsml.x10.TimeseriesTVPType)1 DefaultTVPMeasurementMetadataDocument (net.opengis.waterml.x20.DefaultTVPMeasurementMetadataDocument)1 MeasurementTimeseriesDocument (net.opengis.waterml.x20.MeasurementTimeseriesDocument)1 MeasurementTimeseriesType (net.opengis.waterml.x20.MeasurementTimeseriesType)1 TVPDefaultMetadataPropertyType (net.opengis.waterml.x20.TVPDefaultMetadataPropertyType)1 TVPMeasurementMetadataType (net.opengis.waterml.x20.TVPMeasurementMetadataType)1 InterpolationType (org.n52.shetland.ogc.om.series.tsml.TimeseriesMLConstants.InterpolationType)1