Search in sources :

Example 1 with GetResultType

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

the class SosDecoderv20 method parseGetResult.

private OwsServiceRequest parseGetResult(final GetResultDocument getResultDoc) throws DecodingException {
    final GetResultType getResult = getResultDoc.getGetResult();
    final GetResultRequest sosGetResultRequest = new GetResultRequest();
    sosGetResultRequest.setService(getResult.getService());
    sosGetResultRequest.setVersion(getResult.getVersion());
    sosGetResultRequest.setOffering(getResult.getOffering());
    sosGetResultRequest.setObservedProperty(getResult.getObservedProperty());
    sosGetResultRequest.setFeatureIdentifiers(Arrays.asList(getResult.getFeatureOfInterestArray()));
    getResult.getFeatureOfInterestArray();
    if (getResult.isSetSpatialFilter()) {
        sosGetResultRequest.setSpatialFilter(parseSpatialFilter4GetResult(getResult.getSpatialFilter()));
    }
    sosGetResultRequest.setExtensions(parseExtensibleRequest(getResult));
    sosGetResultRequest.setTemporalFilter(parseTemporalFilters4GetResult(getResult.getTemporalFilterArray()));
    return sosGetResultRequest;
}
Also used : GetResultRequest(org.n52.shetland.ogc.sos.request.GetResultRequest) GetResultType(net.opengis.sos.x20.GetResultType)

Example 2 with GetResultType

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

the class SosRequestEncoderv20 method createGetResultRequest.

private XmlObject createGetResultRequest(final GetResultRequest request) throws EncodingException {
    final GetResultDocument getResultDoc = GetResultDocument.Factory.newInstance(getXmlOptions());
    final GetResultType getResult = getResultDoc.addNewGetResult();
    getResult.setService(request.getService());
    getResult.setVersion(request.getVersion());
    getResult.setOffering(request.getOffering());
    getResult.setObservedProperty(request.getObservedProperty());
    if (request.isSetFeatureOfInterest()) {
        request.getFeatureIdentifiers().forEach(getResult::addFeatureOfInterest);
    }
    if (request.hasTemporalFilter()) {
        for (final TemporalFilter temporalFilter : request.getTemporalFilter()) {
            createTemporalFilter(getResult.addNewTemporalFilter(), temporalFilter);
        }
    }
    if (request.isSetSpatialFilter()) {
        createSpatialFilter(getResult.addNewSpatialFilter(), request.getSpatialFilter());
    }
    return getResultDoc;
}
Also used : TemporalFilter(org.n52.shetland.ogc.filter.TemporalFilter) GetResultDocument(net.opengis.sos.x20.GetResultDocument) GetResultType(net.opengis.sos.x20.GetResultType)

Aggregations

GetResultType (net.opengis.sos.x20.GetResultType)2 GetResultDocument (net.opengis.sos.x20.GetResultDocument)1 TemporalFilter (org.n52.shetland.ogc.filter.TemporalFilter)1 GetResultRequest (org.n52.shetland.ogc.sos.request.GetResultRequest)1