Search in sources :

Example 1 with Term

use of net.opengis.sensorML.x101.TermDocument.Term in project arctic-sea by 52North.

the class SensorMLEncoderv101 method createIdentification.

/**
 * Creates the valueentification section of the SensorML description.
 *
 * @param identifications
 *            SOS valueentifications
 *
 * @return XML Identification array
 */
protected Identification[] createIdentification(List<SmlIdentifier> identifications) {
    Identification xbIdentification = Identification.Factory.newInstance(getXmlOptions());
    IdentifierList xbIdentifierList = xbIdentification.addNewIdentifierList();
    identifications.forEach(sosSMLIdentifier -> {
        Identifier xbIdentifier = xbIdentifierList.addNewIdentifier();
        if (sosSMLIdentifier.getName() != null) {
            xbIdentifier.setName(sosSMLIdentifier.getName());
        }
        Term xbTerm = xbIdentifier.addNewTerm();
        xbTerm.setDefinition(sosSMLIdentifier.getDefinition());
        xbTerm.setValue(sosSMLIdentifier.getValue());
    });
    return new Identification[] { xbIdentification };
}
Also used : Identifier(net.opengis.sensorML.x101.IdentificationDocument.Identification.IdentifierList.Identifier) SmlIdentifier(org.n52.shetland.ogc.sensorML.elements.SmlIdentifier) Identification(net.opengis.sensorML.x101.IdentificationDocument.Identification) Term(net.opengis.sensorML.x101.TermDocument.Term) IdentifierList(net.opengis.sensorML.x101.IdentificationDocument.Identification.IdentifierList)

Example 2 with Term

use of net.opengis.sensorML.x101.TermDocument.Term in project arctic-sea by 52North.

the class SensorMLDecoderV101Test method addIdentifier.

private void addIdentifier(IdentifierList xbIdentifierList, String name, String definition, String value) {
    Identifier xbIdentifier = xbIdentifierList.addNewIdentifier();
    xbIdentifier.setName(name);
    Term xbTerm = xbIdentifier.addNewTerm();
    xbTerm.setDefinition(definition);
    xbTerm.setValue(value);
}
Also used : Identifier(net.opengis.sensorML.x101.IdentificationDocument.Identification.IdentifierList.Identifier) Term(net.opengis.sensorML.x101.TermDocument.Term)

Example 3 with Term

use of net.opengis.sensorML.x101.TermDocument.Term 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

Term (net.opengis.sensorML.x101.TermDocument.Term)3 Identifier (net.opengis.sensorML.x101.IdentificationDocument.Identification.IdentifierList.Identifier)2 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 Identification (net.opengis.sensorML.x101.IdentificationDocument.Identification)1 IdentifierList (net.opengis.sensorML.x101.IdentificationDocument.Identification.IdentifierList)1 SmlClassifier (org.n52.shetland.ogc.sensorML.elements.SmlClassifier)1 SmlIdentifier (org.n52.shetland.ogc.sensorML.elements.SmlIdentifier)1