Search in sources :

Example 1 with GetFeatureOfInterestResponseDocument

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

the class GetFeatureOfInterestResponseDocumentDecoder method decode.

@Override
@SuppressFBWarnings("NP_LOAD_OF_KNOWN_NULL_VALUE")
public GetFeatureOfInterestResponse decode(GetFeatureOfInterestResponseDocument gfoird) throws DecodingException {
    if (gfoird != null) {
        GetFeatureOfInterestResponse response = new GetFeatureOfInterestResponse();
        setService(response);
        setVersions(response);
        GetFeatureOfInterestResponseType gfoirt = gfoird.getGetFeatureOfInterestResponse();
        response.setExtensions(parseExtensibleResponse(gfoirt));
        response.setAbstractFeature(parseFeatures(gfoirt));
        return response;
    }
    throw new UnsupportedDecoderInputException(this, gfoird);
}
Also used : GetFeatureOfInterestResponse(org.n52.shetland.ogc.sos.response.GetFeatureOfInterestResponse) GetFeatureOfInterestResponseType(net.opengis.sos.x20.GetFeatureOfInterestResponseType) UnsupportedDecoderInputException(org.n52.svalbard.decode.exception.UnsupportedDecoderInputException) SuppressFBWarnings(edu.umd.cs.findbugs.annotations.SuppressFBWarnings)

Example 2 with GetFeatureOfInterestResponseDocument

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

the class GetFeatureOfInterestResponseEncoder method create.

@Override
protected XmlObject create(GetFeatureOfInterestResponse response) throws EncodingException {
    GetFeatureOfInterestResponseDocument document = GetFeatureOfInterestResponseDocument.Factory.newInstance(getXmlOptions());
    GetFeatureOfInterestResponseType xbGetFoiResponse = document.addNewGetFeatureOfInterestResponse();
    AbstractFeature feature = response.getAbstractFeature();
    if (feature instanceof FeatureCollection) {
        for (AbstractFeature f : (FeatureCollection) feature) {
            addFeatureOfInterest(f, xbGetFoiResponse);
        }
    } else if (feature instanceof SamplingFeature) {
        addFeatureOfInterest(feature, xbGetFoiResponse);
    }
    XmlHelper.makeGmlIdsUnique(document.getDomNode());
    return document;
}
Also used : FeatureCollection(org.n52.shetland.ogc.om.features.FeatureCollection) GetFeatureOfInterestResponseType(net.opengis.sos.x20.GetFeatureOfInterestResponseType) GetFeatureOfInterestResponseDocument(net.opengis.sos.x20.GetFeatureOfInterestResponseDocument) AbstractFeature(org.n52.shetland.ogc.gml.AbstractFeature) SamplingFeature(org.n52.shetland.ogc.om.features.samplingFeatures.SamplingFeature)

Aggregations

GetFeatureOfInterestResponseType (net.opengis.sos.x20.GetFeatureOfInterestResponseType)2 SuppressFBWarnings (edu.umd.cs.findbugs.annotations.SuppressFBWarnings)1 GetFeatureOfInterestResponseDocument (net.opengis.sos.x20.GetFeatureOfInterestResponseDocument)1 AbstractFeature (org.n52.shetland.ogc.gml.AbstractFeature)1 FeatureCollection (org.n52.shetland.ogc.om.features.FeatureCollection)1 SamplingFeature (org.n52.shetland.ogc.om.features.samplingFeatures.SamplingFeature)1 GetFeatureOfInterestResponse (org.n52.shetland.ogc.sos.response.GetFeatureOfInterestResponse)1 UnsupportedDecoderInputException (org.n52.svalbard.decode.exception.UnsupportedDecoderInputException)1