Skip to content

output

output

This module contains the result of a process job. It is shaped along the results of OGC API - Processes - Part 1: Core (https://schemas.opengis.net/ogcapi/processes/part1/1.0/openapi/schemas/results.yaml), per output either the literal value or a reference to the file. The outputs are a list of entries with their id instead of a map by id, see ExecuteInput.

ProcessResult dataclass

Bases: BaseInterface

The result of a process. A worker ships it as xsdata JSON in the data of the JobResult, so the dispatcher can parse it back without knowing anything about QGIS.

Attributes:

  • outputs (list[ResultOutput]) –

    The outputs of the process.

  • log (str) –

    The log the QGIS algorithm wrote while it was running. It has no place in the results of OGC API - Processes and travels next to the outputs.

Source code in src/qgis_server_light/interface/job/process/output.py
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
@dataclass(repr=False)
class ProcessResult(BaseInterface):
    """The result of a process. A worker ships it as xsdata JSON in the data of
    the `JobResult`, so the dispatcher can parse it back without knowing
    anything about QGIS.

    Attributes:
        outputs: The outputs of the process.
        log: The log the QGIS algorithm wrote while it was running. It has no place in
            the results of OGC API - Processes and travels next to the outputs.
    """

    outputs: list[ResultOutput] = field(default_factory=list, metadata={"type": "Element"})
    log: str = field(default="", metadata={"type": "Element"})

    @property
    def shortened_fields(self) -> set:
        return {"log"}

log: str = field(default='', metadata={'type': 'Element'}) class-attribute instance-attribute

outputs: list[ResultOutput] = field(default_factory=list, metadata={'type': 'Element'}) class-attribute instance-attribute

shortened_fields: set property

__init__(outputs: list[ResultOutput] = list(), log: str = '') -> None

Reference dataclass

A file a process wrote into the process output dir of the worker.

Attributes:

  • href (str) –

    The path of the file relative to the process output dir.

  • type (str) –

    The media type of the file.

Source code in src/qgis_server_light/interface/job/process/output.py
13
14
15
16
17
18
19
20
21
22
23
@dataclass
class Reference:
    """A file a process wrote into the process output dir of the worker.

    Attributes:
        href: The path of the file relative to the process output dir.
        type: The media type of the file.
    """

    href: str = field(metadata={"type": "Element"})
    type: str = field(metadata={"type": "Element"})

href: str = field(metadata={'type': 'Element'}) class-attribute instance-attribute

type: str = field(metadata={'type': 'Element'}) class-attribute instance-attribute

__init__(href: str, type: str) -> None

ResultOutput dataclass

A single output of a process, the counterpart of ExecuteInput.

Attributes:

  • id (str) –

    The identifier of the output, the QGIS output name.

  • value (Reference | str | int | float | bool) –

    The file the output was written to, or the literal value of the output.

Source code in src/qgis_server_light/interface/job/process/output.py
26
27
28
29
30
31
32
33
34
35
36
37
@dataclass
class ResultOutput:
    """A single output of a process, the counterpart of `ExecuteInput`.

    Attributes:
        id: The identifier of the output, the QGIS output name.
        value: The file the output was written to, or the literal value of the
            output.
    """

    id: str = field(metadata={"type": "Element"})
    value: Reference | str | int | float | bool = field(metadata={"type": "Element"})

id: str = field(metadata={'type': 'Element'}) class-attribute instance-attribute

value: Reference | str | int | float | bool = field(metadata={'type': 'Element'}) class-attribute instance-attribute

__init__(id: str, value: Reference | str | int | float | bool) -> None