Search in sources :

Example 1 with ClassifierListPropertyType

use of net.opengis.sensorml.x20.ClassifierListPropertyType in project arctic-sea by 52North.

the class SensorMLDecoderV20 method parseClassification.

/**
 * Parses the classification
 *
 * @param clpts
 *            XML classification
 * @return SOS classification
 */
private List<SmlClassifier> parseClassification(final ClassifierListPropertyType[] clpts) {
    final List<SmlClassifier> sosClassifiers = new ArrayList<>(clpts.length);
    for (final ClassifierListPropertyType clpt : clpts) {
        if (clpt.isSetClassifierList()) {
            ClassifierListType clt = clpt.getClassifierList();
            if (CollectionHelper.isNotNullOrEmpty(clt.getClassifierArray())) {
                for (final Classifier c : clt.getClassifierArray()) {
                    if (c.getTerm() != null) {
                        final SmlClassifier smlClassifier = new SmlClassifier();
                        parseTerm(c.getTerm(), smlClassifier);
                        sosClassifiers.add(smlClassifier);
                    }
                }
            }
        }
    }
    return sosClassifiers;
}
Also used : SmlClassifier(org.n52.shetland.ogc.sensorML.elements.SmlClassifier) ArrayList(java.util.ArrayList) SmlClassifier(org.n52.shetland.ogc.sensorML.elements.SmlClassifier) Classifier(net.opengis.sensorml.x20.ClassifierListType.Classifier) ClassifierListType(net.opengis.sensorml.x20.ClassifierListType) ClassifierListPropertyType(net.opengis.sensorml.x20.ClassifierListPropertyType)

Example 2 with ClassifierListPropertyType

use of net.opengis.sensorml.x20.ClassifierListPropertyType in project arctic-sea by 52North.

the class SensorMLEncoderv20 method createClassification.

/**
 * Creates the classification section of the SensorML description.
 *
 * @param classifications
 *            SOS classifications
 *
 * @return XML Classification array
 */
private ClassifierListPropertyType[] createClassification(final List<SmlClassifier> classifications) {
    ClassifierListPropertyType xbClassification = ClassifierListPropertyType.Factory.newInstance(getXmlOptions());
    ClassifierListType xbClassifierList = xbClassification.addNewClassifierList();
    classifications.forEach(classifier -> createTerm(xbClassifierList.addNewClassifier().addNewTerm(), classifier));
    return new ClassifierListPropertyType[] { xbClassification };
}
Also used : ClassifierListType(net.opengis.sensorml.x20.ClassifierListType) ClassifierListPropertyType(net.opengis.sensorml.x20.ClassifierListPropertyType)

Aggregations

ClassifierListPropertyType (net.opengis.sensorml.x20.ClassifierListPropertyType)2 ClassifierListType (net.opengis.sensorml.x20.ClassifierListType)2 ArrayList (java.util.ArrayList)1 Classifier (net.opengis.sensorml.x20.ClassifierListType.Classifier)1 SmlClassifier (org.n52.shetland.ogc.sensorML.elements.SmlClassifier)1