pygeoapi icon indicating copy to clipboard operation
pygeoapi copied to clipboard

Add support for parameter Outputs of OGC API Processes

Open francescoingv opened this issue 1 year ago • 1 comments

Overview

Allows the request parameter outputs to be passed on to the Processor.

The parameter outputs is passed to the Manager, which in turn pass it to the Processor, subject to the Processor being declared to support the outputs parameter:

class XxxProcessor(BaseProcessor):
    def __init__(self, processor_def):
        super().__init__(processor_def, PROCESS_METADATA)
        self.supports_outputs = True

The conditional parameter passing to the Processor grant backward compatibility for already developed Processors.

By default the Processor returns all the outputs defined into the section outputs of PROCESS_METADATA. If the processor receives the parameter outputs (a dictionary), then only the outputs with the key present into the parameter should be returned.

Each item of outputs may contain the property transmissionMode, which may take the value: value or reference. By default transmissionMode=value.

Related Issue / discussion

This PR address and solve issue #1420 This PR solve one Subset of issue #1285

Possibly the following issue (or enhancement) could be requested:

  • error 501 to be raised on receiving the parameter outputs, and not having the Processor handling it.

Additional information

This PR has a breaking signature in BaseManager.execute_process()

To check the Processor compatibility, the example processor HelloWorldProcessor has supports_outputs=True, while EchoProcessor has not supports_outputs property (default to False).

Dependency policy (RFC2)

  • [X] I have ensured that this PR meets RFC2 requirements

Updates to public demo

  • [ ] I have ensured that breaking changes to the pygeoapi master demo server have been addressed
    • [ ] https://github.com/geopython/demo.pygeoapi.io/blob/master/services/pygeoapi_master/local.config.yml

Contributions and licensing

(as per https://github.com/geopython/pygeoapi/blob/master/CONTRIBUTING.md#contributions-and-licensing)

  • [X] I'd like to contribute [feature X|bugfix Y|docs|something else] to pygeoapi. I confirm that my contributions to pygeoapi will be compatible with the pygeoapi license guidelines at the time of contribution
  • [X] I have already previously agreed to the pygeoapi Contributions and Licensing Guidelines

francescoingv avatar Mar 20 '24 08:03 francescoingv

I don't know "how to" address the requirements on "Updates to public demo". Please advice on the steps to verify this requirement.

francescoingv avatar Mar 20 '24 08:03 francescoingv

As stated in online comments, it is not the aim nor the scope of the present PR (related to the issue #1420 ) to enable handling of multiple outputs. Currently the outputs parameter propagation it is only aimed to allow proper handling of the property transmissionMode. In my opinion the handling of the property transmissionMode may (and should) be handled within the manager.

I will rise a new issue with the target of handling the property transmissionMode when this PR will be eventually merged.

Given that a process can now produce multiple outputs, the process manager needs to also be updated in order to deal with it.

As stated inline, I have no problem for this, but tried to follow current practice to minimize impact on current development. A comment from the maintainers (@tomkralidis ?) is required.

Additionally, as mentioned inline, I would not introduce the supports_outputs flag in the BaseProcessor, but I understand the rationale for including it. I guess this is up for discussion.

francescoingv avatar Apr 15 '24 11:04 francescoingv

2024-05-10: as discussed during the pygeoapi online meeting, lgtm.

tomkralidis avatar May 10 '24 12:05 tomkralidis