Search in sources :

Example 1 with Classifier

use of net.opengis.sensorML.x101.ClassificationDocument.Classification.ClassifierList.Classifier in project arctic-sea by 52North.

the class SensorMLEncoderv101 method createClassification.

/**
 * Creates the classification section of the SensorML description.
 *
 * @param classifications
 *            SOS classifications
 *
 * @return XML Classification array
 */
private Classification[] createClassification(List<SmlClassifier> classifications) {
    Classification xbClassification = Classification.Factory.newInstance(getXmlOptions());
    ClassifierList xbClassifierList = xbClassification.addNewClassifierList();
    classifications.forEach(sosSMLClassifier -> {
        Classifier xbClassifier = xbClassifierList.addNewClassifier();
        if (sosSMLClassifier.getName() != null) {
            xbClassifier.setName(sosSMLClassifier.getName());
        }
        Term xbTerm = xbClassifier.addNewTerm();
        xbTerm.setValue(sosSMLClassifier.getValue());
        if (sosSMLClassifier.isSetDefinition()) {
            xbTerm.setDefinition(sosSMLClassifier.getDefinition());
        }
        if (sosSMLClassifier.isSetCodeSpace()) {
            xbTerm.addNewCodeSpace().setHref(sosSMLClassifier.getCodeSpace());
        }
    });
    return new Classification[] { xbClassification };
}
Also used : Classification(net.opengis.sensorML.x101.ClassificationDocument.Classification) ClassifierList(net.opengis.sensorML.x101.ClassificationDocument.Classification.ClassifierList) SmlClassifier(org.n52.shetland.ogc.sensorML.elements.SmlClassifier) Classifier(net.opengis.sensorML.x101.ClassificationDocument.Classification.ClassifierList.Classifier) Term(net.opengis.sensorML.x101.TermDocument.Term)

Aggregations

Classification (net.opengis.sensorML.x101.ClassificationDocument.Classification)1 ClassifierList (net.opengis.sensorML.x101.ClassificationDocument.Classification.ClassifierList)1 Classifier (net.opengis.sensorML.x101.ClassificationDocument.Classification.ClassifierList.Classifier)1 Term (net.opengis.sensorML.x101.TermDocument.Term)1 SmlClassifier (org.n52.shetland.ogc.sensorML.elements.SmlClassifier)1