Search in sources :

Example 6 with Identifier

use of org.n52.shetland.inspire.base.Identifier in project arctic-sea by 52North.

the class WmlObservationProcessDecoderv20 method parseObservationProcess.

private Object parseObservationProcess(ObservationProcessType opt) throws DecodingException {
    ObservationProcess observationProcess = new ObservationProcess();
    observationProcess.setGmlId(opt.getId());
    // parse identifier, names, description, locations
    parseAbstractFeatureType(opt, observationProcess);
    parseProcessType(opt, observationProcess);
    parseOriginatingProcess(opt, observationProcess);
    parseAggregatingDuration(opt, observationProcess);
    parseVerticalDatum(opt, observationProcess);
    parseComment(opt, observationProcess);
    parseProcessReference(opt, observationProcess);
    parseInput(opt, observationProcess);
    parseParameter(opt, observationProcess);
    setDescriptionXml(opt, observationProcess);
    return observationProcess;
}
Also used : ObservationProcess(org.n52.shetland.ogc.om.series.wml.ObservationProcess)

Example 7 with Identifier

use of org.n52.shetland.inspire.base.Identifier in project arctic-sea by 52North.

the class OmDecoderv20 method parseOmObservation.

private OmObservation parseOmObservation(OMObservationType omObservation) throws DecodingException {
    Map<String, AbstractFeature> featureMap = Maps.newHashMap();
    OmObservation sosObservation = new OmObservation();
    // parse identifier, description
    parseAbstractFeatureType(omObservation, sosObservation);
    OmObservationConstellation observationConstallation = getObservationConstellation(omObservation, featureMap);
    sosObservation.setObservationConstellation(observationConstallation);
    sosObservation.setResultTime(getResultTime(omObservation));
    sosObservation.setValidTime(getValidTime(omObservation));
    if (omObservation.getParameterArray() != null) {
        sosObservation.setParameter(parseNamedValueTypeArray(omObservation.getParameterArray()));
    }
    sosObservation.setValue(getObservationValue(omObservation));
    return sosObservation;
}
Also used : OmObservation(org.n52.shetland.ogc.om.OmObservation) AbstractFeature(org.n52.shetland.ogc.gml.AbstractFeature) XmlString(org.apache.xmlbeans.XmlString) OmObservationConstellation(org.n52.shetland.ogc.om.OmObservationConstellation)

Example 8 with Identifier

use of org.n52.shetland.inspire.base.Identifier in project arctic-sea by 52North.

the class SamplingDecoderv20 method parseSpatialSamplingFeature.

private AbstractFeature parseSpatialSamplingFeature(final SFSpatialSamplingFeatureType spatialSamplingFeature) throws DecodingException {
    final SamplingFeature sosFeat = new SamplingFeature(null, spatialSamplingFeature.getId());
    // parse identifier, names, description
    parseAbstractFeatureType(spatialSamplingFeature, sosFeat);
    sosFeat.setFeatureType(getFeatureType(spatialSamplingFeature.getType()));
    sosFeat.setSampledFeatures(getSampledFeatures(spatialSamplingFeature.getSampledFeatureArray()));
    sosFeat.setXml(getXmlDescription(spatialSamplingFeature));
    sosFeat.setGeometry(getGeometry(spatialSamplingFeature.getShape()));
    checkTypeAndGeometry(sosFeat);
    sosFeat.setGmlId(spatialSamplingFeature.getId());
    return sosFeat;
}
Also used : SamplingFeature(org.n52.shetland.ogc.om.features.samplingFeatures.SamplingFeature)

Example 9 with Identifier

use of org.n52.shetland.inspire.base.Identifier in project arctic-sea by 52North.

the class SensorMLDecoderV101 method parseIdentifications.

/**
 * Parses the identifications and sets the AbstractProcess' identifiers
 *
 * @param abstractProcess The AbstractProcess to which identifiers are added
 * @param identificationArray XML identification
 */
private void parseIdentifications(final AbstractProcess abstractProcess, final Identification[] identificationArray) {
    for (final Identification xbIdentification : identificationArray) {
        if (xbIdentification.getIdentifierList() != null) {
            for (final Identifier xbIdentifier : xbIdentification.getIdentifierList().getIdentifierArray()) {
                if (xbIdentifier.getName() != null && xbIdentifier.getTerm() != null) {
                    final SmlIdentifier identifier = new SmlIdentifier(xbIdentifier.getName(), xbIdentifier.getTerm().getDefinition(), xbIdentifier.getTerm().getValue());
                    abstractProcess.addIdentifier(identifier);
                    if (isIdentificationProcedureIdentifier(identifier)) {
                        abstractProcess.setIdentifier(identifier.getValue());
                    }
                }
            }
        }
    }
}
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) SmlIdentifier(org.n52.shetland.ogc.sensorML.elements.SmlIdentifier)

Example 10 with Identifier

use of org.n52.shetland.inspire.base.Identifier 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)

Aggregations

Test (org.junit.Test)8 CodeType (org.n52.shetland.ogc.gml.CodeType)5 XmlObject (org.apache.xmlbeans.XmlObject)4 CodeWithAuthority (org.n52.shetland.ogc.gml.CodeWithAuthority)4 SmlIdentifier (org.n52.shetland.ogc.sensorML.elements.SmlIdentifier)4 Identifier (net.opengis.sensorML.x101.IdentificationDocument.Identification.IdentifierList.Identifier)3 Identifier (org.n52.shetland.inspire.base.Identifier)3 SamplingFeature (org.n52.shetland.ogc.om.features.samplingFeatures.SamplingFeature)3 URI (java.net.URI)2 Identification (net.opengis.sensorML.x101.IdentificationDocument.Identification)2 IdentifierList (net.opengis.sensorML.x101.IdentificationDocument.Identification.IdentifierList)2 XmlString (org.apache.xmlbeans.XmlString)2 EReportingChange (org.n52.shetland.aqd.EReportingChange)2 EReportingHeader (org.n52.shetland.aqd.EReportingHeader)2 GeographicalName (org.n52.shetland.inspire.GeographicalName)2 Pronunciation (org.n52.shetland.inspire.Pronunciation)2 Spelling (org.n52.shetland.inspire.Spelling)2 AddressRepresentation (org.n52.shetland.inspire.ad.AddressRepresentation)2 Contact (org.n52.shetland.inspire.base2.Contact)2 RelatedParty (org.n52.shetland.inspire.base2.RelatedParty)2