use of org.n52.shetland.ogc.sos.gda.GetDataAvailabilityResponse.FormatDescriptor in project arctic-sea by 52North.
the class GetDataAvailabilityV20StreamWriter method writeFormatDescriptor.
protected void writeFormatDescriptor(FormatDescriptor formatDescriptor) throws XMLStreamException {
start(GetDataAvailabilityConstants.GDA_20_FORMAT_DESCRIPTOR);
writeProcedureDescriptionFormatDescriptor(formatDescriptor.getProcedureDescriptionFormatDescriptor());
for (ObservationFormatDescriptor ofd : formatDescriptor.getObservationFormatDescriptors()) {
writeObservationFormatDescriptor(ofd);
}
end(GetDataAvailabilityConstants.GDA_20_FORMAT_DESCRIPTOR);
}
use of org.n52.shetland.ogc.sos.gda.GetDataAvailabilityResponse.FormatDescriptor in project arctic-sea by 52North.
the class GetDataAvailabilityResponseDecoder method parseDataAvalabilities.
private Collection<DataAvailability> parseDataAvalabilities(net.opengis.sosgda.x20.GetDataAvailabilityResponseType response) throws DecodingException {
List<DataAvailability> availabilities = Lists.newArrayList();
if (CollectionHelper.isNotNullOrEmpty(response.getDataAvailabilityMemberArray())) {
Map<String, TimePeriod> periods = Maps.newHashMap();
for (net.opengis.sosgda.x20.DataAvailabilityMemberType damt : response.getDataAvailabilityMemberArray()) {
ReferenceType procedure = decodeXmlElement(damt.getProcedure());
ReferenceType offering = decodeXmlElement(damt.getOffering());
ReferenceType featureOfInterest = decodeXmlElement(damt.getFeatureOfInterest());
ReferenceType observedProperty = decodeXmlElement(damt.getObservedProperty());
TimePeriod phenomenonTime = getPhenomenonTime(damt.getPhenomenonTime().getAbstractTimeObject(), damt.getPhenomenonTime().getHref(), periods);
DataAvailability dataAvailability = new DataAvailability(procedure, observedProperty, featureOfInterest, offering, phenomenonTime);
FormatDescriptor formatDescriptor = createFormatDescriptor(damt.getFormatDescriptor());
if (formatDescriptor != null) {
dataAvailability.setFormatDescriptor(formatDescriptor);
}
availabilities.add(dataAvailability);
}
}
return availabilities;
}
use of org.n52.shetland.ogc.sos.gda.GetDataAvailabilityResponse.FormatDescriptor in project arctic-sea by 52North.
the class GetDataAvailabilityResponseDecoder method createFormatDescriptor.
private FormatDescriptor createFormatDescriptor(FormatDescriptorType fdt) {
if (fdt != null) {
String procDescFormatDescriptor = fdt.getProcedureDescriptionFormatDescriptor().getProcedureDescriptionFormat();
Set<ObservationFormatDescriptor> obsFormDescs = Sets.newHashSet();
for (ObservationFormatDescriptorType obsFormatDescriptor : fdt.getObservationFormatDescriptorArray()) {
obsFormDescs.add(new ObservationFormatDescriptor(obsFormatDescriptor.getResponseFormat(), Sets.newHashSet(obsFormatDescriptor.getObservationTypeArray())));
}
return new FormatDescriptor(new ProcedureDescriptionFormatDescriptor(procDescFormatDescriptor), obsFormDescs);
}
return null;
}
Aggregations