Search in sources :

Example 1 with FormatDescriptor

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);
}
Also used : ObservationFormatDescriptor(org.n52.shetland.ogc.sos.gda.GetDataAvailabilityResponse.ObservationFormatDescriptor)

Example 2 with FormatDescriptor

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;
}
Also used : TimePeriod(org.n52.shetland.ogc.gml.time.TimePeriod) DataAvailability(org.n52.shetland.ogc.sos.gda.GetDataAvailabilityResponse.DataAvailability) ProcedureDescriptionFormatDescriptor(org.n52.shetland.ogc.sos.gda.GetDataAvailabilityResponse.ProcedureDescriptionFormatDescriptor) ObservationFormatDescriptor(org.n52.shetland.ogc.sos.gda.GetDataAvailabilityResponse.ObservationFormatDescriptor) FormatDescriptor(org.n52.shetland.ogc.sos.gda.GetDataAvailabilityResponse.FormatDescriptor) ReferenceType(org.n52.shetland.ogc.gml.ReferenceType)

Example 3 with FormatDescriptor

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;
}
Also used : ObservationFormatDescriptorType(net.opengis.sosgda.x20.ObservationFormatDescriptorType) ObservationFormatDescriptor(org.n52.shetland.ogc.sos.gda.GetDataAvailabilityResponse.ObservationFormatDescriptor) ProcedureDescriptionFormatDescriptor(org.n52.shetland.ogc.sos.gda.GetDataAvailabilityResponse.ProcedureDescriptionFormatDescriptor) ProcedureDescriptionFormatDescriptor(org.n52.shetland.ogc.sos.gda.GetDataAvailabilityResponse.ProcedureDescriptionFormatDescriptor) ObservationFormatDescriptor(org.n52.shetland.ogc.sos.gda.GetDataAvailabilityResponse.ObservationFormatDescriptor) FormatDescriptor(org.n52.shetland.ogc.sos.gda.GetDataAvailabilityResponse.FormatDescriptor)

Aggregations

ObservationFormatDescriptor (org.n52.shetland.ogc.sos.gda.GetDataAvailabilityResponse.ObservationFormatDescriptor)3 FormatDescriptor (org.n52.shetland.ogc.sos.gda.GetDataAvailabilityResponse.FormatDescriptor)2 ProcedureDescriptionFormatDescriptor (org.n52.shetland.ogc.sos.gda.GetDataAvailabilityResponse.ProcedureDescriptionFormatDescriptor)2 ObservationFormatDescriptorType (net.opengis.sosgda.x20.ObservationFormatDescriptorType)1 ReferenceType (org.n52.shetland.ogc.gml.ReferenceType)1 TimePeriod (org.n52.shetland.ogc.gml.time.TimePeriod)1 DataAvailability (org.n52.shetland.ogc.sos.gda.GetDataAvailabilityResponse.DataAvailability)1