Search in sources :

Example 1 with GetObservationType

use of net.opengis.sos.x20.GetObservationType in project arctic-sea by 52North.

the class GetObservationRequestEncoder method create.

@Override
protected XmlObject create(GetObservationRequest request) throws EncodingException {
    GetObservationDocument doc = GetObservationDocument.Factory.newInstance(getXmlOptions());
    GetObservationType got = doc.addNewGetObservation();
    addService(got, request);
    addVersion(got, request);
    addExtension(got, request);
    addProcedure(got, request);
    addOffering(got, request);
    addObservedProperty(got, request);
    addTemporalFilter(got, request);
    addFeatureOfInterest(got, request);
    addSpatialFilter(got, request);
    addResponseFormat(got, request);
    return doc;
}
Also used : GetObservationDocument(net.opengis.sos.x20.GetObservationDocument) GetObservationType(net.opengis.sos.x20.GetObservationType)

Example 2 with GetObservationType

use of net.opengis.sos.x20.GetObservationType in project arctic-sea by 52North.

the class SosDecoderv20 method parseGetObservation.

/**
 * parses the XmlBean representing the getObservation request and creates a
 * SoSGetObservation request
 *
 * @param getObsDoc
 *            XmlBean created from the incoming request stream
 * @return Returns SosGetObservationRequest representing the request
 *
 * @throws DecodingException
 *             * If parsing the XmlBean failed
 */
private OwsServiceRequest parseGetObservation(final GetObservationDocument getObsDoc) throws DecodingException {
    final GetObservationRequest getObsRequest = new GetObservationRequest();
    final GetObservationType getObsType = getObsDoc.getGetObservation();
    // TODO: check
    getObsRequest.setService(getObsType.getService());
    getObsRequest.setVersion(getObsType.getVersion());
    getObsRequest.setOfferings(Arrays.asList(getObsType.getOfferingArray()));
    getObsRequest.setObservedProperties(Arrays.asList(getObsType.getObservedPropertyArray()));
    getObsRequest.setProcedures(Arrays.asList(getObsType.getProcedureArray()));
    getObsRequest.setTemporalFilters(parseTemporalFilters4GetObservation(getObsType.getTemporalFilterArray()));
    if (getObsType.isSetSpatialFilter()) {
        getObsRequest.setSpatialFilter(parseSpatialFilter4GetObservation(getObsType.getSpatialFilter()));
    }
    getObsRequest.setFeatureIdentifiers(Arrays.asList(getObsType.getFeatureOfInterestArray()));
    if (getObsType.isSetResponseFormat()) {
        try {
            final String responseFormat = URLDecoder.decode(getObsType.getResponseFormat(), "UTF-8");
            getObsRequest.setResponseFormat(responseFormat);
        } catch (final UnsupportedEncodingException e) {
            throw new DecodingException(e, "Error while encoding response format!");
        }
    }
    getObsRequest.setExtensions(parseExtensibleRequest(getObsType));
    return getObsRequest;
}
Also used : GetObservationRequest(org.n52.shetland.ogc.sos.request.GetObservationRequest) GetObservationType(net.opengis.sos.x20.GetObservationType) UnsupportedEncodingException(java.io.UnsupportedEncodingException) DecodingException(org.n52.svalbard.decode.exception.DecodingException) XmlString(org.apache.xmlbeans.XmlString)

Aggregations

GetObservationType (net.opengis.sos.x20.GetObservationType)2 UnsupportedEncodingException (java.io.UnsupportedEncodingException)1 GetObservationDocument (net.opengis.sos.x20.GetObservationDocument)1 XmlString (org.apache.xmlbeans.XmlString)1 GetObservationRequest (org.n52.shetland.ogc.sos.request.GetObservationRequest)1 DecodingException (org.n52.svalbard.decode.exception.DecodingException)1