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;
}
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;
}
Aggregations