Search in sources :

Example 1 with QualityPropertyType

use of net.opengis.swe.x20.QualityPropertyType in project arctic-sea by 52North.

the class SweCommonEncoderv101 method createQuality.

private QualityPropertyType[] createQuality(Collection<SweQuality> quality) {
    if (!quality.isEmpty()) {
        ArrayList<QualityPropertyType> xbQualities = Lists.newArrayListWithCapacity(quality.size());
        for (SweQuality sweQuality : quality) {
            QualityPropertyType xbQuality = QualityPropertyType.Factory.newInstance();
            if (sweQuality instanceof SweText) {
                xbQuality.addNewText().set(createText((SweText) sweQuality));
            } else if (sweQuality instanceof SweCategory) {
                xbQuality.addNewCategory().set(createCategory((SweCategory) sweQuality));
            } else if (sweQuality instanceof SweQuantity) {
                xbQuality.addNewQuantity().set(createQuantity((SweQuantity) sweQuality));
            } else if (sweQuality instanceof SweQuantityRange) {
                xbQuality.addNewQuantityRange().set(createQuantityRange((SweQuantityRange) sweQuality));
            }
            xbQualities.add(xbQuality);
        }
        return xbQualities.toArray(new QualityPropertyType[xbQualities.size()]);
    }
    return new QualityPropertyType[] { QualityPropertyType.Factory.newInstance() };
}
Also used : SweQuantity(org.n52.shetland.ogc.swe.simpleType.SweQuantity) SweQuality(org.n52.shetland.ogc.swe.simpleType.SweQuality) QualityPropertyType(net.opengis.swe.x101.QualityPropertyType) SweText(org.n52.shetland.ogc.swe.simpleType.SweText) SweQuantityRange(org.n52.shetland.ogc.swe.simpleType.SweQuantityRange) SweCategory(org.n52.shetland.ogc.swe.simpleType.SweCategory)

Example 2 with QualityPropertyType

use of net.opengis.swe.x20.QualityPropertyType in project arctic-sea by 52North.

the class SweCommonEncoderv20 method createQuality.

private QualityPropertyType[] createQuality(final Collection<SweQuality> quality) throws EncodingException {
    if (!quality.isEmpty()) {
        final ArrayList<QualityPropertyType> xbQualities = Lists.newArrayListWithCapacity(quality.size());
        for (final SweQuality sweQuality : quality) {
            final QualityPropertyType xbQuality = QualityPropertyType.Factory.newInstance();
            if (sweQuality instanceof SweText) {
                xbQuality.addNewText().set(((SweText) sweQuality).accept(new SweDataComponentVisitorImpl()));
            } else if (sweQuality instanceof SweCategory) {
                xbQuality.addNewCategory().set(((SweCategory) sweQuality).accept(new SweDataComponentVisitorImpl()));
            } else if (sweQuality instanceof SweQuantity) {
                xbQuality.addNewQuantity().set(((SweQuantity) sweQuality).accept(new SweDataComponentVisitorImpl()));
            } else if (sweQuality instanceof SweQuantityRange) {
                xbQuality.addNewQuantityRange().set(((SweQuantityRange) sweQuality).accept(new SweDataComponentVisitorImpl()));
            }
            xbQualities.add(xbQuality);
        }
        return xbQualities.toArray(new QualityPropertyType[xbQualities.size()]);
    }
    final QualityPropertyType[] result = { QualityPropertyType.Factory.newInstance() };
    return result;
}
Also used : SweQuantity(org.n52.shetland.ogc.swe.simpleType.SweQuantity) SweQuality(org.n52.shetland.ogc.swe.simpleType.SweQuality) QualityPropertyType(net.opengis.swe.x20.QualityPropertyType) SweText(org.n52.shetland.ogc.swe.simpleType.SweText) SweQuantityRange(org.n52.shetland.ogc.swe.simpleType.SweQuantityRange) SweCategory(org.n52.shetland.ogc.swe.simpleType.SweCategory)

Aggregations

SweCategory (org.n52.shetland.ogc.swe.simpleType.SweCategory)2 SweQuality (org.n52.shetland.ogc.swe.simpleType.SweQuality)2 SweQuantity (org.n52.shetland.ogc.swe.simpleType.SweQuantity)2 SweQuantityRange (org.n52.shetland.ogc.swe.simpleType.SweQuantityRange)2 SweText (org.n52.shetland.ogc.swe.simpleType.SweText)2 QualityPropertyType (net.opengis.swe.x101.QualityPropertyType)1 QualityPropertyType (net.opengis.swe.x20.QualityPropertyType)1