Search in sources :

Example 1 with ObservationFormatDescriptor

use of org.n52.shetland.ogc.sos.gda.GetDataAvailabilityResponse.ObservationFormatDescriptor in project arctic-sea by 52North.

the class GetDataAvailabilityJsonEncoder method encodeObservationFormatDescriptor.

private void encodeObservationFormatDescriptor(Set<ObservationFormatDescriptor> observationFormatDescriptors, ObjectNode fdNode) {
    ArrayNode ofdArray = fdNode.putArray(GetDataAvailabilityConstants.OBSERVATION_FORMAT_DESCRIPTOR);
    for (ObservationFormatDescriptor ofd : observationFormatDescriptors) {
        ObjectNode ofdNode = ofdArray.addObject();
        ofdNode.put(GetDataAvailabilityConstants.RESPONSE_FORMAT, ofd.getResponseFormat());
        ArrayNode otArray = ofdNode.putArray(GetDataAvailabilityConstants.OBSERVATION_TYPE);
        for (String obsType : ofd.getObservationTypes()) {
            otArray.add(obsType);
        }
    }
}
Also used : ObjectNode(com.fasterxml.jackson.databind.node.ObjectNode) ObservationFormatDescriptor(org.n52.shetland.ogc.sos.gda.GetDataAvailabilityResponse.ObservationFormatDescriptor) ArrayNode(com.fasterxml.jackson.databind.node.ArrayNode)

Example 2 with ObservationFormatDescriptor

use of org.n52.shetland.ogc.sos.gda.GetDataAvailabilityResponse.ObservationFormatDescriptor 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 3 with ObservationFormatDescriptor

use of org.n52.shetland.ogc.sos.gda.GetDataAvailabilityResponse.ObservationFormatDescriptor 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 ArrayNode (com.fasterxml.jackson.databind.node.ArrayNode)1 ObjectNode (com.fasterxml.jackson.databind.node.ObjectNode)1 ObservationFormatDescriptorType (net.opengis.sosgda.x20.ObservationFormatDescriptorType)1 FormatDescriptor (org.n52.shetland.ogc.sos.gda.GetDataAvailabilityResponse.FormatDescriptor)1 ProcedureDescriptionFormatDescriptor (org.n52.shetland.ogc.sos.gda.GetDataAvailabilityResponse.ProcedureDescriptionFormatDescriptor)1