Search in sources :

Example 6 with OmObservationConstellation

use of org.n52.shetland.ogc.om.OmObservationConstellation in project arctic-sea by 52North.

the class ObservationDecoder method parseObservationConstellation.

public OmObservationConstellation parseObservationConstellation(JsonNode node) throws DecodingException {
    OmObservationConstellation oc = new OmObservationConstellation();
    oc.setProcedure(parseProcedure(node));
    oc.setObservableProperty(parseObservableProperty(node));
    oc.setObservationType(parseObservationType(node));
    oc.setFeatureOfInterest(parseFeatureOfInterest(node));
    return oc;
}
Also used : OmObservationConstellation(org.n52.shetland.ogc.om.OmObservationConstellation)

Example 7 with OmObservationConstellation

use of org.n52.shetland.ogc.om.OmObservationConstellation in project arctic-sea by 52North.

the class InsertResultTemplateRequestDecoder method parseObservationTemplate.

private OmObservationConstellation parseObservationTemplate(JsonNode node) throws DecodingException {
    OmObservationConstellation oc = observationDecoder.parseObservationConstellation(node.path(JSONConstants.OBSERVATION_TEMPLATE));
    oc.addOffering(node.path(JSONConstants.OFFERING).textValue());
    return oc;
}
Also used : OmObservationConstellation(org.n52.shetland.ogc.om.OmObservationConstellation)

Example 8 with OmObservationConstellation

use of org.n52.shetland.ogc.om.OmObservationConstellation in project arctic-sea by 52North.

the class SosDecoderv20 method parseInsertResultTemplate.

private OwsServiceRequest parseInsertResultTemplate(final InsertResultTemplateDocument insertResultTemplateDoc) throws DecodingException {
    InsertResultTemplateRequest sosInsertResultTemplate = new InsertResultTemplateRequest();
    InsertResultTemplateType insertResultTemplate = insertResultTemplateDoc.getInsertResultTemplate();
    sosInsertResultTemplate.setService(insertResultTemplate.getService());
    sosInsertResultTemplate.setVersion(insertResultTemplate.getVersion());
    ResultTemplateType resultTemplate = insertResultTemplate.getProposedTemplate().getResultTemplate();
    sosInsertResultTemplate.setIdentifier(resultTemplate.getIdentifier());
    OmObservationConstellation sosObservationConstellation = parseObservationTemplate(resultTemplate.getObservationTemplate());
    sosObservationConstellation.addOffering(resultTemplate.getOffering());
    sosInsertResultTemplate.setObservationTemplate(sosObservationConstellation);
    try {
        sosInsertResultTemplate.setResultStructure(parseResultStructure(XmlObject.Factory.parse(resultTemplate.getResultStructure().xmlText())));
        sosInsertResultTemplate.setResultEncoding(parseResultEncoding(XmlObject.Factory.parse(resultTemplate.getResultEncoding().xmlText())));
    } catch (XmlException e) {
        throw new DecodingException(e, "Error while parsing InsertResultTemplate request!");
    }
    sosInsertResultTemplate.setExtensions(parseExtensibleRequest(insertResultTemplate));
    return sosInsertResultTemplate;
}
Also used : InsertResultTemplateType(net.opengis.sos.x20.InsertResultTemplateType) XmlException(org.apache.xmlbeans.XmlException) DecodingException(org.n52.svalbard.decode.exception.DecodingException) OmObservationConstellation(org.n52.shetland.ogc.om.OmObservationConstellation) ResultTemplateType(net.opengis.sos.x20.ResultTemplateType) GetResultTemplateType(net.opengis.sos.x20.GetResultTemplateType) InsertResultTemplateType(net.opengis.sos.x20.InsertResultTemplateType) InsertResultTemplateRequest(org.n52.shetland.ogc.sos.request.InsertResultTemplateRequest)

Example 9 with OmObservationConstellation

use of org.n52.shetland.ogc.om.OmObservationConstellation in project arctic-sea by 52North.

the class OmDecoderv20 method getObservationConstellation.

private OmObservationConstellation getObservationConstellation(OMObservationType omot, Map<String, AbstractFeature> featureMap) throws DecodingException {
    OmObservationConstellation observationConstellation = new OmObservationConstellation();
    observationConstellation.setObservationType(getObservationType(omot));
    observationConstellation.setProcedure(createProcedure(omot));
    observationConstellation.setObservableProperty(getObservableProperty(omot));
    observationConstellation.setFeatureOfInterest(createFeatureOfInterest(omot, featureMap));
    return observationConstellation;
}
Also used : OmObservationConstellation(org.n52.shetland.ogc.om.OmObservationConstellation)

Example 10 with OmObservationConstellation

use of org.n52.shetland.ogc.om.OmObservationConstellation 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)

Aggregations

OmObservationConstellation (org.n52.shetland.ogc.om.OmObservationConstellation)28 Test (org.junit.Test)18 OmObservableProperty (org.n52.shetland.ogc.om.OmObservableProperty)8 AbstractFeature (org.n52.shetland.ogc.gml.AbstractFeature)7 SamplingFeature (org.n52.shetland.ogc.om.features.samplingFeatures.SamplingFeature)7 InsertResultTemplateRequest (org.n52.shetland.ogc.sos.request.InsertResultTemplateRequest)6 CodeWithAuthority (org.n52.shetland.ogc.gml.CodeWithAuthority)5 OMObservationType (net.opengis.om.x20.OMObservationType)4 CodeType (org.n52.shetland.ogc.gml.CodeType)4 Matchers.containsString (org.hamcrest.Matchers.containsString)3 TimeInstant (org.n52.shetland.ogc.gml.time.TimeInstant)3 OmObservation (org.n52.shetland.ogc.om.OmObservation)3 SweDataRecord (org.n52.shetland.ogc.swe.SweDataRecord)3 DateTime (org.joda.time.DateTime)2 SensorML (org.n52.shetland.ogc.sensorML.SensorML)2 SosResultStructure (org.n52.shetland.ogc.sos.SosResultStructure)2 SweField (org.n52.shetland.ogc.swe.SweField)2 Date (java.util.Date)1 SFSamplingFeatureDocument (net.opengis.sampling.x20.SFSamplingFeatureDocument)1 SFSamplingFeatureType (net.opengis.sampling.x20.SFSamplingFeatureType)1