interface
interface
common
This module contains common logic, shared beyond all specialised parts of the QGIS-Server-Light interface.
BBox
dataclass
Bases: BaseInterface
Source code in src/qgis_server_light/interface/common.py
143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 | |
x_max: float = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
x_min: float = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
y_max: float = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
y_min: float = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
z_max: float = field(default=0.0, metadata={'type': 'Element'})
class-attribute
instance-attribute
z_min: float = field(default=0.0, metadata={'type': 'Element'})
class-attribute
instance-attribute
__init__(x_min: float, x_max: float, y_min: float, y_max: float, z_min: float = 0.0, z_max: float = 0.0) -> None
from_list(bbox_list: list[float]) -> BBox
staticmethod
Takes a list representation of a BBox in the form
[
Source code in src/qgis_server_light/interface/common.py
191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 | |
from_string(bbox_string: str) -> BBox
staticmethod
Takes a CSV string representation of a BBox in the form
'
Source code in src/qgis_server_light/interface/common.py
164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 | |
to_2d_list() -> list
Source code in src/qgis_server_light/interface/common.py
158 159 | |
to_2d_string() -> str
Source code in src/qgis_server_light/interface/common.py
161 162 | |
to_list() -> list
Source code in src/qgis_server_light/interface/common.py
152 153 | |
to_string() -> str
Source code in src/qgis_server_light/interface/common.py
155 156 | |
BaseInterface
dataclass
This class should be used as base class for all dataclasses in the interface. It offers useful methods to handle exposed content in a centralized way. Mainly for logging redaction.
Since dataclasses gets a repr method installed automatically when they are created, a dataclass inheriting from this base class has to be defined as follows:
@dataclass(repr=False)
class Config(BaseInterface):
id: int = field(metadata={"type": "Element"})
secure: str = field(metadata={"type": "Element"})
long_content: str = field(metadata={"type": "Element"})
@property
def shortened_fields(self) -> set:
return {"long_content"}
@property
def redacted_fields(self) -> set:
return {"secure"}
This way, when an instance of this example class gets logged somewhere it the output will be redacted, meaning the logging output might look like this:
Config(id=1, secure=**REDACTED**, long_content=abc12...io345)
Source code in src/qgis_server_light/interface/common.py
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 | |
redacted_fields: set
property
Field which contents should get redacted before printing them on the log. This is mainly used to prevent passwords in logs.
Returns:
-
set–The set of field names which should be redacted
shorten_limit: int
property
The limit to which the content of a field should be shortened.
Returns:
-
int–The limit.
shortened_fields: set
property
Fields which should be shortened to a length, this is manly useful for large content fields with BLOB etc.
Returns:
-
set–The set field names which should be shortened.
__init__() -> None
__repr__()
Source code in src/qgis_server_light/interface/common.py
86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 | |
Crs
dataclass
Bases: BaseInterface
Source code in src/qgis_server_light/interface/common.py
218 219 220 221 222 223 224 225 226 227 228 229 | |
auth_id: str = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
axis_inverted: bool = field(default=False, metadata={'type': 'Element'})
class-attribute
instance-attribute
ogc_uri: str = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
ogc_urn: str = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
postgis_srid: int = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
__init__(auth_id: str = None, postgis_srid: int = None, ogc_uri: str = None, ogc_urn: str = None, axis_inverted: bool = False) -> None
RedactedString
This special string class can be used to handle secret strings in the application. It works like a normal string but in case it's used to print or log its value is not reveled to the output.
Source code in src/qgis_server_light/interface/common.py
109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 | |
__format__(format_spec)
Source code in src/qgis_server_light/interface/common.py
126 127 | |
__init__(value, redacted_text='**REDACTED**')
Source code in src/qgis_server_light/interface/common.py
116 117 118 | |
__json__()
Source code in src/qgis_server_light/interface/common.py
129 130 | |
__repr__()
Source code in src/qgis_server_light/interface/common.py
123 124 | |
__str__()
Source code in src/qgis_server_light/interface/common.py
120 121 | |
reveal()
Allows access to the original value when necessary.
Returns:
-
–
The secret string.
Source code in src/qgis_server_light/interface/common.py
132 133 134 135 136 137 138 139 140 | |
Style
dataclass
Bases: BaseInterface
Source code in src/qgis_server_light/interface/common.py
232 233 234 235 236 237 238 239 | |
definition: str = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
name: str = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
shortened_fields: set
property
__init__(name: str, definition: str) -> None
dispatcher
common
JobState
dataclass
The state of a job which keeps its state (see RedisStateProtocol) as
it was read from the job hash. It gives the dispatcher one thing to hand
over instead of the raw redis fields.
Attributes:
-
id(str) –The unique identifier of the job.
-
status(Status) –The current status of the job.
-
last_update(str | None) –ISO timestamp of the last status change.
-
result(JobResult | None) –The result of a succeeded job.
-
message(str | None) –The error message of a failed job, or why a dismissed one stopped.
-
progress(int | None) –The percentage (0-100) the job reported last,
Noneif it reported none (yet).
Source code in src/qgis_server_light/interface/dispatcher/common.py
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 | |
finished: bool
property
If the job reached a final status, nothing changes on it anymore.
id: str = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
last_update: str | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
message: str | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
progress: int | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
result: JobResult | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
status: Status = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
__init__(id: str, status: Status, last_update: str | None = None, result: JobResult | None = None, message: str | None = None, progress: int | None = None) -> None
Status
Bases: Enum
Source code in src/qgis_server_light/interface/dispatcher/common.py
9 10 11 12 13 14 | |
DISMISSED = 'dismissed'
class-attribute
instance-attribute
FAILURE = 'failed'
class-attribute
instance-attribute
QUEUED = 'queued'
class-attribute
instance-attribute
RUNNING = 'running'
class-attribute
instance-attribute
SUCCESS = 'succeed'
class-attribute
instance-attribute
Worker
dataclass
A worker the dispatcher has seen alive on the queue. It carries what a consumer needs to tell whether jobs can be served and what the worker is doing right now.
Attributes:
-
id(str) –The unique identifier of the worker.
-
last_seen(datetime) –The time of the last heartbeat of the worker, always timezone aware.
-
info(EngineInfo) –The info the worker published with its last heartbeat (status, QGIS version, start time).
Source code in src/qgis_server_light/interface/dispatcher/common.py
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | |
id: str
instance-attribute
info: EngineInfo
instance-attribute
last_seen: datetime
instance-attribute
__init__(id: str, last_seen: datetime, info: EngineInfo) -> None
protocol
This contains the protocol definition about how a job is passed around a redis queue. It is shared by the dispatcher and the worker and therefore must not depend on anything else than the standard library.
RedisProtocol
Names of the redis queue, the job hash fields and the notification
channel a job is exchanged with. It is the common ground of both ways a
job result is delivered, the concrete queue is defined by the subclasses
RedisPublishProtocol and RedisStateProtocol.
A job is put into redis as hash under job:{id} (see job_key) and its
id is pushed onto the list returned by queue_name. A worker listens on
the queue of the protocol it is built on. The hash holds the fields:
info: The job info serialized as JSON.info_type: The class name of the job info, used to parseinfo.status: The currentStatusvalue of the job.timestamp.{status}: ISO timestamp when the job entered that status.timestamp.last_update: ISO timestamp of the last status change.duration: Seconds since the job was posted, as string.
The channel notifications:{id} (see channel) is used to tell a waiting
dispatcher that the job is finished. What is sent over it depends on the
subclass.
A worker registers itself as hash under worker:{id} (see worker_key) and
adds its id to the set worker_list_name. The hash holds the fields:
info: The engine info serialized as JSON.last_seen: ISO timestamp (UTC) of the last heartbeat.processes: The descriptions of the processes a process-worker serves (ProcessDescriptions) as JSON, only written by process-workers.
Attributes:
-
job_queue_name(str) –The name of the redis list the ids of the jobs are queued on. Set by the subclasses.
-
job_info_key(str) –The hash field holding the serialized job info.
-
job_info_type_key(str) –The hash field holding the class name of the job info.
-
job_channel_name(str) –The prefix of the channel a finished job is notified on.
-
job_status_key(str) –The hash field holding the job status.
-
job_duration_key(str) –The hash field holding the job duration.
-
job_timestamp_key(str) –The prefix of the hash fields holding the timestamps.
-
job_last_update_key(str) –The hash field holding the timestamp of the last update.
-
worker_list_name(str) –The name of the redis set the worker ids are registered in.
-
worker_info_key(str) –The hash field holding the serialized engine info.
-
worker_last_seen_key(str) –The hash field holding the timestamp of the last heartbeat.
-
worker_heartbeat_interval(int) –Seconds between two heartbeats of a worker.
-
worker_alive_age(int) –Seconds a heartbeat may be old for the worker to count as alive.
-
worker_processes_key(str) –The hash field holding the descriptions of the processes the worker serves.
Source code in src/qgis_server_light/interface/dispatcher/protocol.py
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 | |
job_channel_name: str = 'notifications'
class-attribute
instance-attribute
job_duration_key: str = 'duration'
class-attribute
instance-attribute
job_info_key: str = 'info'
class-attribute
instance-attribute
job_info_type_key: str = 'info_type'
class-attribute
instance-attribute
job_last_update_key: str = f'{job_timestamp_key}.last_update'
class-attribute
instance-attribute
job_queue_name: str
instance-attribute
job_status_key: str = 'status'
class-attribute
instance-attribute
job_timestamp_key: str = 'timestamp'
class-attribute
instance-attribute
worker_alive_age: int = 10 * worker_heartbeat_interval
class-attribute
instance-attribute
worker_heartbeat_interval: int = 1
class-attribute
instance-attribute
worker_info_key: str = 'info'
class-attribute
instance-attribute
worker_last_seen_key: str = 'last_seen'
class-attribute
instance-attribute
worker_list_name: str = 'workers'
class-attribute
instance-attribute
worker_processes_key: str = 'processes'
class-attribute
instance-attribute
channel(job_id: str) -> str
classmethod
The channel a finished job is notified on.
Parameters:
-
job_id(str) –The unique identifier of the job.
Source code in src/qgis_server_light/interface/dispatcher/protocol.py
87 88 89 90 91 92 93 94 | |
job_key(job_id: str) -> str
staticmethod
The key of the redis hash holding the job.
Parameters:
-
job_id(str) –The unique identifier of the job.
Source code in src/qgis_server_light/interface/dispatcher/protocol.py
71 72 73 74 75 76 77 78 | |
queue_name() -> str
classmethod
The name of the queue the jobs of this protocol are queued on. It is a method on purpose, so the place where the name is decided stays the same if it ever needs to be assembled.
Source code in src/qgis_server_light/interface/dispatcher/protocol.py
80 81 82 83 84 85 | |
worker_key(worker_id: str) -> str
staticmethod
The key of the redis hash holding the worker registration.
Parameters:
-
worker_id(str) –The unique identifier of the worker.
Source code in src/qgis_server_light/interface/dispatcher/protocol.py
96 97 98 99 100 101 102 103 | |
RedisPublishProtocol
Bases: RedisProtocol
The protocol of short living jobs a dispatcher waits for, like
rendering a map or a legend. The worker publishes the pickled JobResult
over the channel and the dispatcher deletes the job hash after it has
received it. Nothing is kept, a result is only there for the one who is
listening.
Attributes:
-
job_queue_name(str) –The name of the redis list the ids of the jobs are queued on.
Source code in src/qgis_server_light/interface/dispatcher/protocol.py
106 107 108 109 110 111 112 113 114 115 116 117 118 | |
job_queue_name: str = 'jobs'
class-attribute
instance-attribute
RedisStateProtocol
Bases: RedisProtocol
The protocol of jobs which keep their state, these are the processes.
The worker writes the result (or the error message) into the job hash in
the same transaction as the final status, so whoever reads the hash never
sees a finished job without its result. The hash expires after
job_expire seconds, it is the only place the result lives.
Only the status value is sent over the channel and only if the job was
submitted with ExecutionMode.SYNC. It just wakes the waiting dispatcher,
which then reads the job hash. Asynchronous jobs are polled, nobody waits
for a notification there.
Processes are queued on their own list, so long-running processes never block map related jobs.
Additional hash fields:
result: The data of theJobResultof a succeeded job.result_content_type: The content type ofresult.message: The error message of a failed job.progress: The percentage (0-100) the running job reported, only if it reports any. It is written while the job runs, outside the transaction.cancel: Set by the dispatcher to dismiss a job the worker took already. The worker cancels the job and finishes it asdismissed.
Attributes:
-
job_queue_name(str) –The name of the redis list the ids of the jobs are queued on.
-
job_result_key(str) –The hash field holding the result data.
-
job_result_content_type_key(str) –The hash field holding the content type of the result data.
-
job_message_key(str) –The hash field holding the error message.
-
job_progress_key(str) –The hash field holding the progress in percent.
-
job_cancel_key(str) –The hash field asking the worker to cancel the job.
-
job_expire(int) –Seconds the job hash is kept after it was submitted and again after it is finished.
Source code in src/qgis_server_light/interface/dispatcher/protocol.py
121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 | |
job_cancel_key: str = 'cancel'
class-attribute
instance-attribute
job_expire: int = 86400
class-attribute
instance-attribute
job_message_key: str = 'message'
class-attribute
instance-attribute
job_progress_key: str = 'progress'
class-attribute
instance-attribute
job_queue_name: str = 'jobs:process'
class-attribute
instance-attribute
job_result_content_type_key: str = 'result_content_type'
class-attribute
instance-attribute
job_result_key: str = 'result'
class-attribute
instance-attribute
exporter
api
ExportParameters
dataclass
Bases: BaseInterface
The serializable request parameters which are accepted by the exporter service.
Source code in src/qgis_server_light/interface/exporter/api.py
6 7 8 9 10 11 12 13 14 | |
output_format: str = field(metadata={'type': 'Element'}, default='json')
class-attribute
instance-attribute
project_path: str = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
unify_layer_names_by_group: bool = field(metadata={'type': 'Element'}, default=False)
class-attribute
instance-attribute
__init__(project_path: str, unify_layer_names_by_group: bool = False, output_format: str = 'json') -> None
ExportResult
dataclass
Bases: BaseInterface
The serializable response which is provided by the exporter service.
Source code in src/qgis_server_light/interface/exporter/api.py
17 18 19 20 21 22 23 24 | |
content: str = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
successful: bool = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
__init__(successful: bool, content: str) -> None
extract
This module contains all interface definition to translate from QGIS project to QGIS-Server-Light logic and to write the JSON export of the QGIS project
AbstractDataset
dataclass
Bases: LayerLike
Source code in src/qgis_server_light/interface/exporter/extract.py
222 223 224 | |
title: str = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
__init__(id: str, name: str, is_checked: bool, title: str) -> None
Config
dataclass
Bases: ResultWithMessages
Source code in src/qgis_server_light/interface/exporter/extract.py
951 952 953 954 955 956 957 958 959 | |
datasets: Datasets = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
meta_data: MetaData = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
relations: list[Relation] = field(default_factory=list, metadata={'type': 'Element'})
class-attribute
instance-attribute
tree: Tree = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
__init__(project: Project, exporter: Exporter, meta_data: MetaData, tree: Tree, datasets: Datasets, relations: list[Relation] = list(), *, messages: list[ExportMessage] = list()) -> None
Custom
dataclass
Bases: DataSet
Source code in src/qgis_server_light/interface/exporter/extract.py
707 708 709 | |
__init__(id: str, name: str, is_checked: bool, title: str, source: DataSource, driver: str, bbox: BBox | None = None, bbox_wgs84: BBox | None = None, crs: Crs | None = None, styles: list[Style] = list(), minimum_scale: float | None = None, maximum_scale: float | None = None, style_name: str = 'default', is_spatial: bool = True, is_background: bool = False) -> None
DataSet
dataclass
Bases: AbstractDataset
Source code in src/qgis_server_light/interface/exporter/extract.py
646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 | |
bbox: BBox | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
bbox_wgs84: BBox | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
crs: Crs | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
driver: str = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
is_background: bool = field(default=False, metadata={'type': 'Element'})
class-attribute
instance-attribute
is_spatial: bool = field(default=True, metadata={'type': 'Element'})
class-attribute
instance-attribute
maximum_scale: float | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
minimum_scale: float | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
source: DataSource = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
style_name: str = field(default='default', metadata={'type': 'Element'})
class-attribute
instance-attribute
styles: list[Style] = field(default_factory=list, metadata={'type': 'Element'})
class-attribute
instance-attribute
__init__(id: str, name: str, is_checked: bool, title: str, source: DataSource, driver: str, bbox: BBox | None = None, bbox_wgs84: BBox | None = None, crs: Crs | None = None, styles: list[Style] = list(), minimum_scale: float | None = None, maximum_scale: float | None = None, style_name: str = 'default', is_spatial: bool = True, is_background: bool = False) -> None
get_style_by_name(name: str) -> Style | None
Source code in src/qgis_server_light/interface/exporter/extract.py
660 661 662 663 664 | |
style() -> Style | None
Source code in src/qgis_server_light/interface/exporter/extract.py
666 667 | |
DataSource
dataclass
Bases: BaseInterface
Source code in src/qgis_server_light/interface/exporter/extract.py
610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 | |
definition: PostgresSource | WmtsSource | WmsSource | OgrSource | GdalSource | WfsSource | VectorTileSource | XYZSource | WcsSource | None
property
gdal: GdalSource | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
ogr: OgrSource | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
postgres: PostgresSource | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
vector_tile: VectorTileSource | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
wcs: WcsSource | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
wfs: WfsSource | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
wms: WmsSource | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
wmts: WmtsSource | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
xyz: XYZSource | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
__init__(postgres: PostgresSource | None = None, wmts: WmtsSource | None = None, wms: WmsSource | None = None, ogr: OgrSource | None = None, gdal: GdalSource | None = None, wfs: WfsSource | None = None, vector_tile: VectorTileSource | None = None, xyz: XYZSource | None = None, wcs: WcsSource | None = None) -> None
Datasets
dataclass
Bases: BaseInterface
Source code in src/qgis_server_light/interface/exporter/extract.py
812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 | |
custom: list[Custom] = field(default_factory=list, metadata={'type': 'Element'})
class-attribute
instance-attribute
group: list[Group] = field(default_factory=list, metadata={'type': 'Element'})
class-attribute
instance-attribute
raster: list[Raster] = field(default_factory=list, metadata={'type': 'Element'})
class-attribute
instance-attribute
vector: list[Vector] = field(default_factory=list, metadata={'type': 'Element'})
class-attribute
instance-attribute
__init__(vector: list[Vector] = list(), raster: list[Raster] = list(), custom: list[Custom] = list(), group: list[Group] = list()) -> None
find_dataset_by_id(id: str) -> Vector | Raster | Custom | None
Finds a dataset by id in the list of passed datasets.
Parameters:
-
id(str) –The id value which should be looked up
Returns:
Source code in src/qgis_server_light/interface/exporter/extract.py
831 832 833 834 835 836 837 838 839 840 841 842 843 844 | |
find_group_by_id(identifier: str) -> Group | None
Source code in src/qgis_server_light/interface/exporter/extract.py
846 847 848 849 850 | |
EditorWidget
dataclass
Bases: BaseInterface
Holds the configuration of the editor widget of a field. Only one of the
attributes is set, matching Field.editor_widget_type.
Source code in src/qgis_server_light/interface/exporter/extract.py
120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 | |
definition: ValueMap | ValueRelation | RelationReference | Range | None
property
range: Range | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
relation_reference: RelationReference | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
value_map: ValueMap | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
value_relation: ValueRelation | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
__init__(value_map: ValueMap | None = None, value_relation: ValueRelation | None = None, relation_reference: RelationReference | None = None, range: Range | None = None) -> None
ExportMessage
dataclass
Bases: BaseInterface
A warning or error produced while exporting the QGIS project.
Source code in src/qgis_server_light/interface/exporter/extract.py
898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 | |
code: Code = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
layer_id: str | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
level: Level = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
message: str = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
Code
Bases: StrEnum
Source code in src/qgis_server_light/interface/exporter/extract.py
906 907 908 909 910 911 912 913 914 915 916 917 918 | |
FIELD_EDITOR_WIDGET_TYPE_UNSUPPORTED = 'field_editor_widget_type_unsupported'
class-attribute
instance-attribute
LAYER_EMPTY = 'layer_empty'
class-attribute
instance-attribute
LAYER_EXTENT_FROM_PROJECT = 'layer_extent_from_project'
class-attribute
instance-attribute
LAYER_EXTENT_MISSING = 'layer_extent_missing'
class-attribute
instance-attribute
LAYER_EXTENT_REPROJECTION_FAILED = 'layer_extent_reprojection_failed'
class-attribute
instance-attribute
LAYER_INVALID = 'layer_invalid'
class-attribute
instance-attribute
LAYER_PROVIDER_UNSUPPORTED = 'layer_provider_unsupported'
class-attribute
instance-attribute
LAYER_TYPE_UNSUPPORTED = 'layer_type_unsupported'
class-attribute
instance-attribute
PROJECT_READ_FAILED = 'project_read_failed'
class-attribute
instance-attribute
PROJECT_VERSION_UNSUPPORTED = 'project_version_unsupported'
class-attribute
instance-attribute
TREE_NODE_UNSUPPORTED = 'tree_node_unsupported'
class-attribute
instance-attribute
UNEXPECTED_ERROR = 'unexpected_error'
class-attribute
instance-attribute
Level
Bases: StrEnum
Source code in src/qgis_server_light/interface/exporter/extract.py
902 903 904 | |
ERROR = 'error'
class-attribute
instance-attribute
WARNING = 'warning'
class-attribute
instance-attribute
__init__(level: Level, message: str, code: Code, layer_id: str | None = None) -> None
Exporter
dataclass
Bases: BaseInterface
Source code in src/qgis_server_light/interface/exporter/extract.py
893 894 895 | |
qgis_version: str = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
__init__(qgis_version: str) -> None
Field
dataclass
Bases: BaseInterface
Transportable (serializable) form of a QGIS vector job_layer_definition fiel (attribute). It contains the information of the original data datatype and its translated versions and the editor widget one as well.
Attributes:
-
name(str) –Machine readable name of the field
-
type(str) –Original type as defined by data source (PostGIS, GPKG, etc.)
-
is_primary_key(bool) –if the field is considered to be primary key.
-
is_generated(bool) –if the value of the primary key is generated by the source on insert.
-
type_wfs(str | None) –Translated type for further usage. Based on the simple types of XSD spec.
-
type_oapif(str | None) –Translated type based on the types of the OpenAPI Spec
-
type_oapif_format(str | None) –Format of the above-mentioned type based on the OpenAPI Spec
-
alias(str | None) –Human readable name.
-
comment(str | None) –Field description.
-
nullable(bool) –If this field can be NULL or not.
-
length(int | None) –The limitation in length on the field value.
-
precision(int | None) –The precision of the field value (float types)
-
editor_widget_type(str | None) –The original type how it is defined in the QGIS form.
-
editor_widget_type_wfs(str | None) –The translated type based on the simple types of XSD spec.
-
editor_widget_type_oapif(str | None) –Translated type based on the types of the OpenAPI Spec
-
editor_widget_type_oapif_format(str | None) –Format of the above-mentioned type based on the OpenAPI Spec
-
editor_widget(EditorWidget | None) –The configuration of the editor widget. None if the widget type is not one of the exported ones.
-
constraints(FieldConstraints | None) –The constraints of the field. None for exports which did not contain constraints yet.
Source code in src/qgis_server_light/interface/exporter/extract.py
160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 | |
alias: str | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
comment: str | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
constraints: FieldConstraints | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
editor_widget: EditorWidget | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
editor_widget_type: str | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
editor_widget_type_oapif: str | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
editor_widget_type_oapif_format: str | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
editor_widget_type_wfs: str | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
is_generated: bool = field(default=False, metadata={'type': 'Element'})
class-attribute
instance-attribute
is_primary_key: bool = field(default=False, metadata={'type': 'Element'})
class-attribute
instance-attribute
length: int | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
name: str = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
nullable: bool = field(default=True, metadata={'type': 'Element'})
class-attribute
instance-attribute
precision: int | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
type: str = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
type_oapif: str | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
type_oapif_format: str | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
type_wfs: str | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
__init__(name: str, type: str, is_primary_key: bool = False, is_generated: bool = False, type_wfs: str | None = None, type_oapif: str | None = None, type_oapif_format: str | None = None, alias: str | None = None, comment: str | None = None, nullable: bool = True, length: int | None = None, precision: int | None = None, editor_widget_type: str | None = None, editor_widget_type_wfs: str | None = None, editor_widget_type_oapif: str | None = None, editor_widget_type_oapif_format: str | None = None, editor_widget: EditorWidget | None = None, constraints: FieldConstraints | None = None) -> None
FieldConstraints
dataclass
Bases: BaseInterface
The constraints of a field as defined in QGIS (provider or layer).
Attributes:
-
not_null(bool) –If the field must not be NULL.
-
unique(bool) –If the field value must be unique.
-
expression(str | None) –The QGIS expression the field value has to fulfill.
Source code in src/qgis_server_light/interface/exporter/extract.py
144 145 146 147 148 149 150 151 152 153 154 155 156 157 | |
expression: str | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
not_null: bool = field(default=False, metadata={'type': 'Element'})
class-attribute
instance-attribute
unique: bool = field(default=False, metadata={'type': 'Element'})
class-attribute
instance-attribute
__init__(not_null: bool = False, unique: bool = False, expression: str | None = None) -> None
GdalSource
dataclass
Bases: Source
Source code in src/qgis_server_light/interface/exporter/extract.py
246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 | |
layer_name: str | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
path: str = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
remote
property
to_qgis_decoded_uri: dict
property
vsi_prefix: str | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
__init__(path: str, layer_name: str | None = None, vsi_prefix: str | None = None) -> None
from_qgis_decoded_uri(decoded_uri: dict)
classmethod
Source code in src/qgis_server_light/interface/exporter/extract.py
265 266 267 268 269 270 271 | |
Group
dataclass
Bases: AbstractDataset
Holds meta information of a group. It's position in the tree and its children can be derived by id matching.
Source code in src/qgis_server_light/interface/exporter/extract.py
712 713 714 715 716 717 | |
is_expanded: bool = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
__init__(id: str, name: str, is_checked: bool, title: str, is_expanded: bool) -> None
LayerLike
dataclass
Bases: BaseInterface
Source code in src/qgis_server_light/interface/exporter/extract.py
16 17 18 19 20 | |
id: str = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
is_checked: bool = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
name: str = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
__init__(id: str, name: str, is_checked: bool) -> None
MetaData
dataclass
Bases: BaseInterface
Source code in src/qgis_server_light/interface/exporter/extract.py
756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 | |
author: str | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
categories: list[str] | None = field(default_factory=list, metadata={'type': 'Element'})
class-attribute
instance-attribute
creationDateTime: str = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
language: str | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
links: list[str] | None = field(default_factory=list, metadata={'type': 'Element'})
class-attribute
instance-attribute
service: Service = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
__init__(service: Service, links: list[str] | None = list(), language: str | None = None, categories: list[str] | None = list(), creationDateTime: str = None, author: str | None = None) -> None
__post_init__()
Source code in src/qgis_server_light/interface/exporter/extract.py
777 778 779 | |
OgrSource
dataclass
Bases: GdalSource
Source code in src/qgis_server_light/interface/exporter/extract.py
274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 | |
encoded_uri_separator: str
property
layer_id: str | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
subset: str | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
to_qgis_decoded_uri: dict
property
__init__(path: str, layer_name: str | None = None, vsi_prefix: str | None = None, layer_id: str | None = None, subset: str | None = None) -> None
from_qgis_decoded_uri(decoded_uri: dict)
classmethod
Source code in src/qgis_server_light/interface/exporter/extract.py
288 289 290 291 292 293 294 295 296 297 | |
PostgresSource
dataclass
Bases: Source
Source code in src/qgis_server_light/interface/exporter/extract.py
495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 | |
check_primary_key_unicity: str | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
dbname: str | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
geometry_column: str | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
host: str | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
key: str = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
password: str | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
port: int | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
redacted_fields: set
property
remote
property
schema: str | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
service: str | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
sql: str | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
srid: str | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
ssl_mode_text: str | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
sslmode: int | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
table: str = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
to_qgis_decoded_uri: dict
property
type: int | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
username: str | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
__init__(key: str, table: str, schema: str | None = None, geometry_column: str | None = None, dbname: str | None = None, host: str | None = None, password: str | None = None, port: int | None = None, type: int | None = None, username: str | None = None, srid: str | None = None, sslmode: int | None = None, ssl_mode_text: str | None = None, service: str | None = None, check_primary_key_unicity: str | None = None, sql: str | None = None) -> None
from_qgis_decoded_uri(decoded_uri: dict)
classmethod
Source code in src/qgis_server_light/interface/exporter/extract.py
547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 | |
Project
dataclass
Bases: BaseInterface
Source code in src/qgis_server_light/interface/exporter/extract.py
782 783 784 785 | |
name: str = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
version: str = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
__init__(version: str, name: str) -> None
Range
dataclass
Bases: BaseInterface
Configuration of the QGIS Range editor widget.
Attributes:
-
minimum(float | None) –The smallest allowed value.
-
maximum(float | None) –The biggest allowed value.
-
step(float | None) –The step of the widget.
Source code in src/qgis_server_light/interface/exporter/extract.py
104 105 106 107 108 109 110 111 112 113 114 115 116 117 | |
maximum: float | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
minimum: float | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
step: float | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
__init__(minimum: float | None = None, maximum: float | None = None, step: float | None = None) -> None
Raster
dataclass
Bases: DataSet
A real QGIS Raster job_layer_definition. That are usually all QgsRasterLayer
in opposition to QgsVectorTileLayer
which is not a real QgsRasterLayer.
Source code in src/qgis_server_light/interface/exporter/extract.py
670 671 672 673 674 675 676 | |
__init__(id: str, name: str, is_checked: bool, title: str, source: DataSource, driver: str, bbox: BBox | None = None, bbox_wgs84: BBox | None = None, crs: Crs | None = None, styles: list[Style] = list(), minimum_scale: float | None = None, maximum_scale: float | None = None, style_name: str = 'default', is_spatial: bool = True, is_background: bool = False) -> None
Relation
dataclass
Bases: BaseInterface
Transportable form of a QGIS project relation (QgsRelation). The layers are
exported as QGIS layer ids, they are not resolved.
Attributes:
-
id(str) –The id of the relation, referenced by
RelationReference.relation_id. -
name(str) –The human readable name of the relation.
-
referencing_layer_id(str) –The QGIS layer id of the referencing (child) layer.
-
referenced_layer_id(str) –The QGIS layer id of the referenced (parent) layer.
-
field_pairs(list[RelationFieldPair]) –The field pairs, more than one for composite keys.
-
strength(str) –The strength as named by QGIS,
AssociationorComposition.
Source code in src/qgis_server_light/interface/exporter/extract.py
867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 | |
field_pairs: list[RelationFieldPair] = field(default_factory=list, metadata={'type': 'Element'})
class-attribute
instance-attribute
id: str = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
name: str = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
referenced_layer_id: str = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
referencing_layer_id: str = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
strength: str = field(default='Association', metadata={'type': 'Element'})
class-attribute
instance-attribute
__init__(id: str, name: str, referencing_layer_id: str, referenced_layer_id: str, field_pairs: list[RelationFieldPair] = list(), strength: str = 'Association') -> None
RelationFieldPair
dataclass
Bases: BaseInterface
One field pair of a QGIS project relation.
Attributes:
-
referencing_field(str) –The field of the referencing (child) layer.
-
referenced_field(str) –The field of the referenced (parent) layer.
Source code in src/qgis_server_light/interface/exporter/extract.py
853 854 855 856 857 858 859 860 861 862 863 864 | |
referenced_field: str = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
referencing_field: str = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
__init__(referencing_field: str, referenced_field: str) -> None
RelationReference
dataclass
Bases: BaseInterface
Configuration of the QGIS RelationReference editor widget.
Attributes:
-
relation_id(str) –The id of the project relation, see
Relation.id.
Source code in src/qgis_server_light/interface/exporter/extract.py
92 93 94 95 96 97 98 99 100 101 | |
relation_id: str = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
__init__(relation_id: str) -> None
ResultWithMessages
dataclass
Bases: BaseInterface
Source code in src/qgis_server_light/interface/exporter/extract.py
926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 | |
exporter: Exporter = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
has_errors: bool
property
messages: list[ExportMessage] = field(default_factory=list, kw_only=True, metadata={'type': 'Element'})
class-attribute
instance-attribute
project: Project = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
__init__(project: Project, exporter: Exporter, *, messages: list[ExportMessage] = list()) -> None
error(message: str, code: ExportMessage.Code, layer_id: str | None = None)
Source code in src/qgis_server_light/interface/exporter/extract.py
940 941 942 943 944 | |
warning(message: str, code: ExportMessage.Code, layer_id: str | None = None)
Source code in src/qgis_server_light/interface/exporter/extract.py
934 935 936 937 938 | |
Service
dataclass
Bases: BaseInterface
Source code in src/qgis_server_light/interface/exporter/extract.py
720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 | |
contact_mail: str | None = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
contact_organization: str | None = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
contact_person: str | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
contact_phone: str | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
contact_position: str | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
fees: str | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
keyword_list: str | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
online_resource: str | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
resource_url: str | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
service_abstract: str | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
service_title: str | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
__init__(contact_organization: str | None, contact_mail: str | None, contact_person: str | None = None, contact_phone: str | None = None, contact_position: str | None = None, fees: str | None = None, keyword_list: str | None = None, online_resource: str | None = None, service_abstract: str | None = None, service_title: str | None = None, resource_url: str | None = None) -> None
Source
dataclass
Bases: BaseInterface, ABC
Source code in src/qgis_server_light/interface/exporter/extract.py
227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 | |
to_qgis_decoded_uri: dict
property
__init__() -> None
decide_remote(path: str) -> bool
staticmethod
Source code in src/qgis_server_light/interface/exporter/extract.py
229 230 231 | |
from_qgis_decoded_uri(decoded_uri: dict)
classmethod
Source code in src/qgis_server_light/interface/exporter/extract.py
239 240 241 242 243 | |
Tree
dataclass
Bases: BaseInterface
Source code in src/qgis_server_light/interface/exporter/extract.py
788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 | |
members: list[TreeGroup] = field(default_factory=list, metadata={'type': 'Element'})
class-attribute
instance-attribute
root
property
__init__(members: list[TreeGroup] = list()) -> None
find_by_id(identifier: str) -> TreeGroup | None
Source code in src/qgis_server_light/interface/exporter/extract.py
805 806 807 808 809 | |
find_by_name(name: str) -> TreeGroup | None
Source code in src/qgis_server_light/interface/exporter/extract.py
799 800 801 802 803 | |
TreeGroup
dataclass
Bases: TreeLayer
Source code in src/qgis_server_light/interface/exporter/extract.py
28 29 30 31 | |
children: list[str] = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
is_expanded: bool = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
__init__(id: str, name: str, is_checked: bool, children: list[str], is_expanded: bool) -> None
TreeLayer
dataclass
Bases: LayerLike
Source code in src/qgis_server_light/interface/exporter/extract.py
23 24 25 | |
__init__(id: str, name: str, is_checked: bool) -> None
ValueMap
dataclass
Bases: BaseInterface
Configuration of the QGIS ValueMap editor widget.
Attributes:
-
entries(list[ValueMapEntry]) –The key / description pairs in the order defined in QGIS. The entry representing NULL is not part of it.
-
null_representation(str | None) –The description QGIS shows for NULL, if the widget defines one.
Source code in src/qgis_server_light/interface/exporter/extract.py
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 | |
entries: list[ValueMapEntry] = field(default_factory=list, metadata={'type': 'Element'})
class-attribute
instance-attribute
null_representation: str | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
__init__(entries: list[ValueMapEntry] = list(), null_representation: str | None = None) -> None
ValueMapEntry
dataclass
Bases: BaseInterface
One entry of a QGIS ValueMap editor widget.
Attributes:
-
key(str) –The value which is stored in the field.
-
description(str) –The human readable representation of the value.
Source code in src/qgis_server_light/interface/exporter/extract.py
34 35 36 37 38 39 40 41 42 43 44 45 | |
description: str = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
key: str = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
__init__(key: str, description: str) -> None
ValueRelation
dataclass
Bases: BaseInterface
Configuration of the QGIS ValueRelation editor widget. The referenced layer is
exported as QGIS layer id, it is not resolved.
Attributes:
-
layer_id(str) –The QGIS layer id of the layer the values are taken from.
-
key_field(str) –The field of the referenced layer which is stored.
-
value_field(str) –The field of the referenced layer which is shown.
-
filter_expression(str | None) –The QGIS expression to filter the referenced layer. It may use form context functions like
current_value(). -
allow_multi(bool) –If more than one value can be selected.
-
order_by_value(bool) –If the values are ordered by the value field instead of the key field.
Source code in src/qgis_server_light/interface/exporter/extract.py
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 | |
allow_multi: bool = field(default=False, metadata={'type': 'Element'})
class-attribute
instance-attribute
filter_expression: str | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
key_field: str = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
layer_id: str = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
order_by_value: bool = field(default=False, metadata={'type': 'Element'})
class-attribute
instance-attribute
value_field: str = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
__init__(layer_id: str, key_field: str, value_field: str, filter_expression: str | None = None, allow_multi: bool = False, order_by_value: bool = False) -> None
Vector
dataclass
Bases: DataSet
A real QGIS Vector job_layer_definition. That are usually all QgsVectorLayer
in opposition to QgsVectorTileLayer
which is not a real QgsVectorLayer.
Source code in src/qgis_server_light/interface/exporter/extract.py
679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 | |
fields: list[Field] = field(default_factory=list, metadata={'type': 'Element'})
class-attribute
instance-attribute
geometry_type_simple: str | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
geometry_type_wkb: str | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
__init__(id: str, name: str, is_checked: bool, title: str, source: DataSource, driver: str, bbox: BBox | None = None, bbox_wgs84: BBox | None = None, crs: Crs | None = None, styles: list[Style] = list(), minimum_scale: float | None = None, maximum_scale: float | None = None, style_name: str = 'default', is_spatial: bool = True, is_background: bool = False, fields: list[Field] = list(), geometry_type_simple: str | None = None, geometry_type_wkb: str | None = None) -> None
get_field_by_name(name: str) -> Field | None
Source code in src/qgis_server_light/interface/exporter/extract.py
700 701 702 703 704 | |
VectorTileSource
dataclass
Bases: Source
Source code in src/qgis_server_light/interface/exporter/extract.py
574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 | |
path: str | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
remote
property
style_url: str | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
to_qgis_decoded_uri: dict
property
type: str = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
url: str | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
zmax: int | None = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
zmin: int | None = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
__init__(type: str, zmin: int | None, zmax: int | None, url: str | None = None, path: str | None = None, style_url: str | None = None) -> None
from_qgis_decoded_uri(decoded_uri: dict)
classmethod
Source code in src/qgis_server_light/interface/exporter/extract.py
598 599 600 601 602 603 604 605 606 607 | |
WcsSource
dataclass
Bases: Source
Source of a layer of the QGIS wcs provider. The attributes are the uri
parameters read by the provider (QgsWcsProvider::parseUri and
QgsWcsCapabilities in QGIS src/providers/wcs). Credentials (username,
password, authcfg) and http headers are intentionally not exported.
Source code in src/qgis_server_light/interface/exporter/extract.py
425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 | |
bbox: str | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
cache: str | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
crs: str | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
format: str | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
identifier: str = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
ignore_axis_orientation: bool = field(default=False, metadata={'type': 'Element'})
class-attribute
instance-attribute
ignore_get_map_url: bool = field(default=False, metadata={'type': 'Element'})
class-attribute
instance-attribute
invert_axis_orientation: bool = field(default=False, metadata={'type': 'Element'})
class-attribute
instance-attribute
remote
property
time: str | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
to_qgis_decoded_uri: dict
property
url: str = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
version: str | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
__init__(url: str, identifier: str, crs: str | None = None, format: str | None = None, time: str | None = None, bbox: str | None = None, version: str | None = None, cache: str | None = None, ignore_get_map_url: bool = False, ignore_axis_orientation: bool = False, invert_axis_orientation: bool = False) -> None
from_qgis_decoded_uri(decoded_uri: dict)
classmethod
Source code in src/qgis_server_light/interface/exporter/extract.py
474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 | |
WfsSource
dataclass
Bases: BaseInterface
Source code in src/qgis_server_light/interface/exporter/extract.py
304 305 306 307 308 | |
__init__() -> None
WmsSource
dataclass
Bases: Source
Source code in src/qgis_server_light/interface/exporter/extract.py
342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 | |
contextual_wms_legend: str | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
crs: str = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
dpi_mode: str | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
feature_count: int | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
format: str = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
layers: str = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
remote
property
styles: str | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
to_qgis_decoded_uri: dict
property
url: str = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
__init__(crs: str, format: str, layers: str, url: str, dpi_mode: str | None = None, feature_count: int | None = None, contextual_wms_legend: str | None = None, styles: str | None = None) -> None
from_qgis_decoded_uri(decoded_uri: dict)
classmethod
Source code in src/qgis_server_light/interface/exporter/extract.py
370 371 372 373 374 375 376 377 378 379 380 381 | |
WmtsSource
dataclass
Bases: WmsSource
Source code in src/qgis_server_light/interface/exporter/extract.py
388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 | |
tile_dimensions: str | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
tile_matrix_set: str = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
tile_pixel_ratio: str | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
to_qgis_decoded_uri: dict
property
__init__(crs: str, format: str, layers: str, url: str, dpi_mode: str | None = None, feature_count: int | None = None, contextual_wms_legend: str | None = None, styles: str | None = None, *, tile_matrix_set: str, tile_dimensions: str | None = None, tile_pixel_ratio: str | None = None) -> None
from_qgis_decoded_uri(decoded_uri: dict)
classmethod
Source code in src/qgis_server_light/interface/exporter/extract.py
407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 | |
XYZSource
dataclass
Bases: Source
Source code in src/qgis_server_light/interface/exporter/extract.py
311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 | |
remote
property
to_qgis_decoded_uri: dict
property
type: str | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
url: str = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
zmax: int | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
zmin: int | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
__init__(url: str, zmin: int | None = None, zmax: int | None = None, type: str | None = None) -> None
from_qgis_decoded_uri(decoded_uri: dict)
classmethod
Source code in src/qgis_server_light/interface/exporter/extract.py
328 329 330 331 332 333 334 335 | |
job
common
input
AbstractFilter
dataclass
Bases: BaseInterface
Source code in src/qgis_server_light/interface/job/common/input.py
66 67 68 69 70 71 72 | |
definition: str = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
shortened_fields: set
property
__init__(definition: str) -> None
ExecutionMode
Bases: Enum
If the dispatcher waits for the job (SYNC) or asks for its state later
(ASYNC). Only jobs which keep their state (RedisStateProtocol) use it.
Source code in src/qgis_server_light/interface/job/common/input.py
17 18 19 20 21 22 23 | |
ASYNC = 'async'
class-attribute
instance-attribute
SYNC = 'sync'
class-attribute
instance-attribute
OgcFilter110
dataclass
Bases: AbstractFilter
A filter which definition conforms to
https://schemas.opengis.net/filter/1.1.0/filter.xsd
and which is consumable by qgis.core.QgsOgcUtils.expressionFromOgcFilter.
Source code in src/qgis_server_light/interface/job/common/input.py
75 76 77 78 79 80 81 | |
__init__(definition: str) -> None
OgcFilterFES20
dataclass
Bases: AbstractFilter
A filter which definition conforms to https://www.opengis.net/fes/2.0
and which is consumable by qgis.core.QgsOgcUtils.expressionFromOgcFilter.
Source code in src/qgis_server_light/interface/job/common/input.py
84 85 86 87 88 89 | |
__init__(definition: str) -> None
QslJobInfoParameter
dataclass
Bases: ABC
The common minimal interface of a job which is shipped around. Each job for QSL has to implement at least this interface.
Attributes:
-
id(str) –The unique identifier which is used to recognize the job all over its lifecycle.
-
type(str) –A string based identifier of the job, this is used to quickly determine its nature serialized state.
-
job(QslJobParameter) –The actual job parameters. This is a domain specific dataclass depending on the nature of the actual job.
-
execution_mode(ExecutionMode) –With
ExecutionMode.SYNCthe worker notifies the waiting dispatcher when the job is finished. Only used by jobs which keep their state.
Source code in src/qgis_server_light/interface/job/common/input.py
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 | |
channel_name: str
property
execution_mode: ExecutionMode = field(metadata={'type': 'Element'}, default=(ExecutionMode.SYNC))
class-attribute
instance-attribute
id: str = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
job: QslJobParameter = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
type: str = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
__init__(id: str, type: str, job: QslJobParameter, execution_mode: ExecutionMode = ExecutionMode.SYNC) -> None
QslJobLayer
dataclass
Bases: BaseInterface
Source code in src/qgis_server_light/interface/job/common/input.py
92 93 94 95 96 97 98 99 100 101 102 103 104 105 | |
driver: str = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
filter: OgcFilter110 | OgcFilterFES20 | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
folder_name: str = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
id: str = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
name: str = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
redacted_fields: set
property
remote: bool = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
source: str = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
style: Style | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
__init__(id: str, name: str, source: str, remote: bool, folder_name: str, driver: str, style: Style | None = None, filter: OgcFilter110 | OgcFilterFES20 | None = None) -> None
QslJobParameter
dataclass
Bases: ABC
The minimal interface of a job parameter interface. In the domain specific refinement it holds the relevant information about a job.
Source code in src/qgis_server_light/interface/job/common/input.py
8 9 10 11 12 13 14 | |
__init__() -> None
QslJobParameterMapRelated
dataclass
Bases: QslJobParameter
The minimal interface of a job parameter interface for jobs rendering things in the end.
Attributes:
-
svg_paths(list[str]) –A list of paths to svg's (folders) which are necessary for the job to render nicely.
Source code in src/qgis_server_light/interface/job/common/input.py
54 55 56 57 58 59 60 61 62 63 | |
svg_paths: list[str] = field(default_factory=list, metadata={'type': 'Element'})
class-attribute
instance-attribute
__init__(svg_paths: list[str] = list()) -> None
output
JobResult
dataclass
Bases: BaseInterface
Source code in src/qgis_server_light/interface/job/common/output.py
7 8 9 10 11 12 13 14 15 16 17 | |
content_type: str = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
data: Any = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
id: str = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
shortened_fields: set
property
worker_host_name: str | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
worker_id: str | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
__init__(id: str, data: Any, content_type: str, worker_id: str | None = None, worker_host_name: str | None = None) -> None
crs
input
QslJobInfoCrs
dataclass
Bases: QslJobInfoParameter
Source code in src/qgis_server_light/interface/job/crs/input.py
22 23 24 | |
job: QslJobParameterCrs = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
__init__(id: str, type: str, job: QslJobParameterCrs, execution_mode: ExecutionMode = ExecutionMode.SYNC) -> None
QslJobParameterCrs
dataclass
Bases: QslJobParameter
Resolves crs identifiers into the full crs information as QGIS knows it. This way consuming applications get all identifiers and the axis order without own crs knowledge.
Attributes:
-
identifiers(list[str]) –The crs identifiers to resolve, e.g.
EPSG:4326, URN or URI notation.
Source code in src/qgis_server_light/interface/job/crs/input.py
9 10 11 12 13 14 15 16 17 18 19 | |
identifiers: list[str] = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
__init__(identifiers: list[str]) -> None
output
CrsCollection
dataclass
Bases: BaseInterface
Holds the resolved crs. The order in the list has to be not changed, so that consuming applications can map the response to the passed identifiers.
Attributes:
Source code in src/qgis_server_light/interface/job/crs/output.py
6 7 8 9 10 11 12 13 14 15 16 17 18 | |
crs: list[Crs] = field(default_factory=list, metadata={'type': 'Element'})
class-attribute
instance-attribute
__init__(crs: list[Crs] = list()) -> None
feature
input
FeatureQuery
dataclass
Bases: BaseInterface
Represents definitions of a query to obtain features from a list of layers. Be aware, that filters are not applied to the QslJobLayer in this implementation since passed filters can contain inter-layer-references.
Attributes:
-
layers(list[QslJobLayer]) –A list layers which should only reference vector sources and be queried.
-
aliases(list[str]) –An optional list of alias names. This has to be the same length as the
-
filter(OgcFilterFES20) –An optional filter which might reference all passed layers thats why layers has to be added
-
crs(Crs | None) –An optional crs the geometries of the features are transformed to. If not set, geometries stay in the crs of the layer.
Source code in src/qgis_server_light/interface/job/feature/input.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | |
aliases: list[str] = field(default_factory=list, metadata={'type': 'Element'})
class-attribute
instance-attribute
crs: Crs | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
filter: OgcFilterFES20 = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
layers: list[QslJobLayer] = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
__init__(layers: list[QslJobLayer], aliases: list[str] = list(), filter: OgcFilterFES20 = None, crs: Crs | None = None) -> None
QslJobInfoFeature
dataclass
Bases: QslJobInfoParameter
Source code in src/qgis_server_light/interface/job/feature/input.py
60 61 62 | |
job: QslJobParameterFeature = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
__init__(id: str, type: str, job: QslJobParameterFeature, execution_mode: ExecutionMode = ExecutionMode.SYNC) -> None
QslJobParameterFeature
dataclass
Bases: QslJobParameter
As defined in WFS 2.0 specs, a request can be subdivided in a list of queries. This class is representing that.
Attributes:
-
queries(list[FeatureQuery]) –A list of queries which features should be extracted for.
-
start_index(int) –The offset for paging reason.
-
count(int | None) –The number of results to return.
Source code in src/qgis_server_light/interface/job/feature/input.py
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | |
count: int | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
queries: list[FeatureQuery] = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
start_index: int = field(default=0, metadata={'type': 'Element'})
class-attribute
instance-attribute
__init__(queries: list[FeatureQuery], start_index: int = 0, count: int | None = None) -> None
output
Attribute
dataclass
Bases: BaseInterface
An attribute belonging to a feature. The aim here is to drill down to simple types which can be used in consuming applications without further handling. This does not include the geometry attribute!
Attributes:
-
name(str) –The name of the attribute. Has to match with the name used for exported fields with
Fieldclass. -
value(int | float | str | bool | bytes | None) –Value as simple as possible. It has to be pickleable
Source code in src/qgis_server_light/interface/job/feature/output.py
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | |
name: str = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
value: int | float | str | bool | bytes | None = field(metadata={'type': 'Element', 'format': 'base64'})
class-attribute
instance-attribute
__init__(name: str, value: int | float | str | bool | bytes | None) -> None
Feature
dataclass
Bases: BaseInterface
Feature to hold information of extracted QgsFeature.
Attributes:
-
geometry(Geometry | None) –The geometry representing the feature.
-
attributes(list[Attribute]) –List of attributes defined in this feature.
Source code in src/qgis_server_light/interface/job/feature/output.py
37 38 39 40 41 42 43 44 45 46 47 48 49 50 | |
attributes: list[Attribute] = field(default_factory=list, metadata={'type': 'Element'})
class-attribute
instance-attribute
geometry: Geometry | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
__init__(geometry: Geometry | None = None, attributes: list[Attribute] = list()) -> None
FeatureCollection
dataclass
Bases: BaseInterface
This construction is used to abstract the content of extracted features for pickelable transportation from QSL to the queue. This way we ensure how things are constructed and transported.
Attributes:
-
name(str) –The name of the feature collection. This is the key to match it to requested layers.
-
features(list[Feature]) –The features belonging to the feature collection.
Source code in src/qgis_server_light/interface/job/feature/output.py
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 | |
features: list[Feature] = field(default_factory=list, metadata={'type': 'Element'})
class-attribute
instance-attribute
name: str = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
__init__(name: str, features: list[Feature] = list()) -> None
Geometry
dataclass
Bases: Attribute
Source code in src/qgis_server_light/interface/job/feature/output.py
27 28 29 30 31 32 33 34 | |
name: str = field(default='geometry', metadata={'type': 'Element'})
class-attribute
instance-attribute
shortened_fields: set
property
value: bytes | None = field(default=None, metadata={'type': 'Element', 'format': 'base64'})
class-attribute
instance-attribute
__init__(name: str = 'geometry', value: bytes | None = None) -> None
QueryCollection
dataclass
Bases: BaseInterface
Holds all feature collections which are bound to the passed queries. The order in the list has to be not changed, so that consuming applications can map the response to the passed queries.
Attributes:
-
numbers_matched(str | int) –Information about how many matches are fund for the executed query.
-
feature_collections(list[FeatureCollection]) –The feature collections belonging to the passed queries.
Source code in src/qgis_server_light/interface/job/feature/output.py
72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 | |
feature_collections: list[FeatureCollection] = field(default_factory=list, metadata={'type': 'Element'})
class-attribute
instance-attribute
numbers_matched: str | int = field(default='unknown', metadata={'type': 'Element'})
class-attribute
instance-attribute
__init__(numbers_matched: str | int = 'unknown', feature_collections: list[FeatureCollection] = list()) -> None
feature_info
input
QslJobInfoFeatureInfo
dataclass
Bases: QslJobInfoParameter
Source code in src/qgis_server_light/interface/job/feature_info/input.py
42 43 44 | |
job: QslJobParameterFeatureInfo = field(metadata={'type': 'Element', 'required': True})
class-attribute
instance-attribute
__init__(id: str, type: str, job: QslJobParameterFeatureInfo, execution_mode: ExecutionMode = ExecutionMode.SYNC) -> None
QslJobParameterFeatureInfo
dataclass
Bases: QslJobParameter
A runner to extract feature info
Source code in src/qgis_server_light/interface/job/feature_info/input.py
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | |
I: str | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
INFO_FORMAT: str = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
J: str | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
QUERY_LAYERS: str = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
X: str | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
Y: str | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
decide_x: int
property
decide_y: int
property
query_layers_list
property
__init__(*, INFO_FORMAT: str, QUERY_LAYERS: str, X: str | None = None, Y: str | None = None, I: str | None = None, J: str | None = None) -> None
__post_init__()
Source code in src/qgis_server_light/interface/job/feature_info/input.py
21 22 23 24 25 26 27 | |
output
legend
input
QslJobInfoLegend
dataclass
Bases: QslJobInfoParameter
Source code in src/qgis_server_light/interface/job/legend/input.py
29 30 31 | |
job: QslJobParameterLegend = field(metadata={'type': 'Element', 'required': True})
class-attribute
instance-attribute
__init__(id: str, type: str, job: QslJobParameterLegend, execution_mode: ExecutionMode = ExecutionMode.SYNC) -> None
QslJobParameterLegend
dataclass
Bases: QslJobParameter
Render legend graphics for one or more layers.
Source code in src/qgis_server_light/interface/job/legend/input.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | |
dpi: int = field(default=91, metadata={'type': 'Element'})
class-attribute
instance-attribute
format: str = field(default='image/png', metadata={'type': 'Element'})
class-attribute
instance-attribute
height: int | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
layer_title: bool = field(default=False, metadata={'type': 'Element'})
class-attribute
instance-attribute
layers: list[QslJobLayer] = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
scale: float | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
width: int | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
__init__(*, layers: list[QslJobLayer], format: str = 'image/png', width: int | None = None, height: int | None = None, dpi: int = 91, scale: float | None = None, layer_title: bool = False) -> None
get_layer_by_name(name: str) -> QslJobLayer
Source code in src/qgis_server_light/interface/job/legend/input.py
22 23 24 25 26 | |
output
process
description
This module contains the description of the processes a process-worker serves. It is shaped along the process description of OGC API - Processes - Part 1: Core (https://schemas.opengis.net/ogcapi/processes/part1/1.0/openapi/schemas/process.yaml), so a consumer can expose its elements as they are and only adds what belongs to the API around (links, job control options, conformance, ...).
Optional values default to None. Serialized with
xsdata.formats.dataclass.serializers.dict.DictFactory.FILTER_NONE they are left out,
which gives a plain JSON Schema for each Schema.
QSL_LAYER_FORMAT = 'qsl-layer'
module-attribute
InputDescription
dataclass
Bases: BaseInterface
The description of one input of a process.
OGC API - Processes holds the inputs as map by id. xsdata can't bind a map of dataclasses, therefore the id is part of the description and the inputs are a list.
Attributes:
-
id(str) –The identifier of the input, the QGIS parameter name.
-
title(str) –Human readable name.
-
description(str | None) –Human readable help text.
-
schema(Schema) –The schema of one value.
-
min_occurs(int) –The minimal number of values.
-
max_occurs(int | str) –The maximal number of values,
unboundedfor any.
Source code in src/qgis_server_light/interface/job/process/description.py
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 | |
description: str | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
id: str = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
max_occurs: int | str = field(default=1, metadata={'type': 'Element', 'name': 'maxOccurs'})
class-attribute
instance-attribute
min_occurs: int = field(default=1, metadata={'type': 'Element', 'name': 'minOccurs'})
class-attribute
instance-attribute
schema: Schema = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
shortened_fields: set
property
title: str = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
__init__(*, id: str, title: str, description: str | None = None, schema: Schema, min_occurs: int = 1, max_occurs: int | str = 1) -> None
OutputDescription
dataclass
Bases: BaseInterface
The description of one output of a process. The id is part of the description,
see InputDescription.
Attributes:
-
id(str) –The identifier of the output, the QGIS output name.
-
title(str) –Human readable name.
-
schema(Schema) –The schema of the value.
Source code in src/qgis_server_light/interface/job/process/description.py
112 113 114 115 116 117 118 119 120 121 122 123 124 125 | |
id: str = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
schema: Schema = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
title: str = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
__init__(*, id: str, title: str, schema: Schema) -> None
ProcessDescription
dataclass
Bases: BaseInterface
The description of one process.
Attributes:
-
id(str) –The identifier of the process, the QGIS algorithm id.
-
title(str) –Human readable name.
-
description(str | None) –Human readable help text.
-
inputs(list[InputDescription]) –The inputs which are passed by the client. Destinations are not part of it, they are set by the worker.
-
outputs(list[OutputDescription]) –The outputs the process produces.
-
internal(bool | None) –If the process is for internal use of the consumer only and must not be published. Left out (
None) for a publishable process.
Source code in src/qgis_server_light/interface/job/process/description.py
128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 | |
description: str | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
id: str = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
inputs: list[InputDescription] = field(default_factory=list, metadata={'type': 'Element'})
class-attribute
instance-attribute
internal: bool | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
outputs: list[OutputDescription] = field(default_factory=list, metadata={'type': 'Element'})
class-attribute
instance-attribute
shortened_fields: set
property
title: str = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
__init__(*, id: str, title: str, description: str | None = None, inputs: list[InputDescription] = list(), outputs: list[OutputDescription] = list(), internal: bool | None = None) -> None
ProcessDescriptions
dataclass
Bases: BaseInterface
The processes a process-worker serves (see RedisProtocol.worker_processes_key),
or all process-workers together as the dispatcher merges them.
Attributes:
-
processes(list[ProcessDescription]) –The description per process.
-
warnings(list[ProcessWarning]) –The processes the workers don't agree on, only set by the dispatcher.
Source code in src/qgis_server_light/interface/job/process/description.py
174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 | |
processes: list[ProcessDescription] = field(default_factory=list, metadata={'type': 'Element'})
class-attribute
instance-attribute
warnings: list[ProcessWarning] = field(default_factory=list, metadata={'type': 'Element'})
class-attribute
instance-attribute
__init__(processes: list[ProcessDescription] = list(), warnings: list[ProcessWarning] = list()) -> None
process_by_id(process_id: str) -> ProcessDescription
Parameters:
-
process_id(str) –The identifier of the process.
Raises:
-
LookupError–If no process with this id is described.
Source code in src/qgis_server_light/interface/job/process/description.py
187 188 189 190 191 192 193 194 195 196 197 198 | |
ProcessWarning
dataclass
Bases: BaseInterface
Tells that the process-workers serving a process don't agree on it. They run different QGIS versions or describe the process differently, so a job behaves differently depending on the worker which takes it. The deployment needs to be corrected then.
Attributes:
-
process_id(str) –The identifier of the process.
-
qgis_versions(list[str]) –The QGIS versions of the workers serving the process, the newest first.
-
descriptions_differ(bool) –If the workers describe the process differently.
Source code in src/qgis_server_light/interface/job/process/description.py
155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 | |
descriptions_differ: bool = field(default=False, metadata={'type': 'Element'})
class-attribute
instance-attribute
process_id: str = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
qgis_versions: list[str] = field(default_factory=list, metadata={'type': 'Element'})
class-attribute
instance-attribute
__init__(*, process_id: str, qgis_versions: list[str] = list(), descriptions_differ: bool = False) -> None
QslLayerKind
Bases: Enum
The kinds of layer QSL can load as value of a process input.
Source code in src/qgis_server_light/interface/job/process/description.py
20 21 22 23 24 | |
RASTER = 'raster'
class-attribute
instance-attribute
VECTOR = 'vector'
class-attribute
instance-attribute
QslLayerMarker
dataclass
Bases: BaseInterface
Marks a schema whose value is a layer (QslJobLayer) instead of a literal. A
consumer replaces the marked schema with the layers it offers which match the marker.
Attributes:
-
kinds(list[QslLayerKind]) –The kinds of layer which are accepted.
-
geometry_types(list[str]) –The geometry types of a vector layer which are accepted, named as
qgis.core.Qgis.GeometryType(Point,Line,Polygon,Null). MatchesVector.geometry_type_simpleof the exported project. Applies to vector layers only, empty when no vector layer is accepted. -
source(str | None) –The class name of the QGIS parameter or output the marker was derived from.
Source code in src/qgis_server_light/interface/job/process/description.py
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | |
geometry_types: list[str] = field(default_factory=list, metadata={'type': 'Element'})
class-attribute
instance-attribute
kinds: list[QslLayerKind] = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
source: str | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
__init__(kinds: list[QslLayerKind], geometry_types: list[str] = list(), source: str | None = None) -> None
Schema
dataclass
Bases: BaseInterface
The subset of JSON Schema which is used to describe the values of inputs and outputs.
Attributes:
-
type(str | None) –The JSON Schema type (
string,number,integer,boolean, ...). -
format(str | None) –The format of the value. Layer values carry
QSL_LAYER_FORMAT. -
title(str | None) –Human readable name, used on the entries of
one_of. -
minimum(int | float | None) –The inclusive minimum of a numeric value.
-
maximum(int | float | None) –The inclusive maximum of a numeric value.
-
const(bool | int | float | str | None) –The only valid value, used on the entries of
one_of. -
default(bool | int | float | str | None) –The value used when none is passed.
-
one_of(list[Schema] | None) –The valid values, each as schema with
constandtitle. For a file output the formats it is offered in, each as schema withcontent_media_type, the first one is the default. -
content_media_type(str | None) –The media type of a value which is a file.
-
x_qsl_layer(QslLayerMarker | None) –The marker of a layer value.
Source code in src/qgis_server_light/interface/job/process/description.py
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 | |
const: bool | int | float | str | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
content_media_type: str | None = field(default=None, metadata={'type': 'Element', 'name': 'contentMediaType'})
class-attribute
instance-attribute
default: bool | int | float | str | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
format: str | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
maximum: int | float | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
minimum: int | float | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
one_of: list[Schema] | None = field(default=None, metadata={'type': 'Element', 'name': 'oneOf'})
class-attribute
instance-attribute
title: str | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
type: str | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
x_qsl_layer: QslLayerMarker | None = field(default=None, metadata={'type': 'Element', 'name': 'x-qsl-layer'})
class-attribute
instance-attribute
__init__(*, type: str | None = None, format: str | None = None, title: str | None = None, minimum: int | float | None = None, maximum: int | float | None = None, const: bool | int | float | str | None = None, default: bool | int | float | str | None = None, one_of: list[Schema] | None = None, content_media_type: str | None = None, x_qsl_layer: QslLayerMarker | None = None) -> None
input
This module contains the execute request of a process job. It is shaped along the
execute request of OGC API - Processes - Part 1: Core
(https://schemas.opengis.net/ogcapi/processes/part1/1.0/openapi/schemas/execute.yaml),
carrying its inputs and outputs. OGC API - Processes holds them as maps by id, xsdata
can't bind a map of dataclasses, therefore the id is part of each entry and they are lists
(see InputDescription).
ExecuteInput
dataclass
The value of one input of a process.
Attributes:
-
id(str) –The identifier of the input, the QGIS parameter name.
-
value(list[QslJobLayer | str | int | float | bool]) –The values of the input, one entry for an input taking a single value. A layer value is substituted in place by its
QslJobLayer.
Source code in src/qgis_server_light/interface/job/process/input.py
18 19 20 21 22 23 24 25 26 27 28 29 30 31 | |
id: str = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
value: list[QslJobLayer | str | int | float | bool] = field(default_factory=list, metadata={'type': 'Element'})
class-attribute
instance-attribute
__init__(id: str, value: list[QslJobLayer | str | int | float | bool] = list()) -> None
ExecuteOutput
dataclass
The format a client wants a file output in.
Attributes:
-
id(str) –The identifier of the output, the QGIS output name.
-
format(Format) –The format the output is written in.
Source code in src/qgis_server_light/interface/job/process/input.py
45 46 47 48 49 50 51 52 53 54 55 | |
format: Format = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
id: str = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
__init__(id: str, format: Format) -> None
Format
dataclass
The format of a file output.
Attributes:
-
media_type(str) –One of the media types the description offers for the output.
Source code in src/qgis_server_light/interface/job/process/input.py
34 35 36 37 38 39 40 41 42 | |
media_type: str = field(metadata={'type': 'Element', 'name': 'mediaType'})
class-attribute
instance-attribute
__init__(media_type: str) -> None
QslJobInfoExecuteProcess
dataclass
Bases: QslJobInfoParameter
The job of a process execution, queued with RedisStateQueue.submit.
Source code in src/qgis_server_light/interface/job/process/input.py
74 75 76 77 78 | |
job: QslJobParameterExecuteProcess = field(metadata={'type': 'Element', 'required': True})
class-attribute
instance-attribute
__init__(id: str, type: str, job: QslJobParameterExecuteProcess, execution_mode: ExecutionMode = ExecutionMode.SYNC) -> None
QslJobParameterExecuteProcess
dataclass
Bases: QslJobParameter
The execute request of a process.
Attributes:
-
process_id(str) –The identifier of the process, the QGIS algorithm id.
-
inputs(list[ExecuteInput]) –The values of the inputs, an input which is left out takes its default.
-
outputs(list[ExecuteOutput]) –The formats chosen for file outputs, an output which is left out is written in the first format its description offers.
Source code in src/qgis_server_light/interface/job/process/input.py
58 59 60 61 62 63 64 65 66 67 68 69 70 71 | |
inputs: list[ExecuteInput] = field(default_factory=list, metadata={'type': 'Element'})
class-attribute
instance-attribute
outputs: list[ExecuteOutput] = field(default_factory=list, metadata={'type': 'Element'})
class-attribute
instance-attribute
process_id: str = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
__init__(*, process_id: str, inputs: list[ExecuteInput] = list(), outputs: list[ExecuteOutput] = list()) -> None
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 | |
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 | |
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 | |
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
render
input
QslJobInfoRender
dataclass
Bases: QslJobInfoParameter
Source code in src/qgis_server_light/interface/job/render/input.py
30 31 32 | |
job: QslJobParameterRender = field(metadata={'type': 'Element', 'required': True})
class-attribute
instance-attribute
__init__(id: str, type: str, job: QslJobParameterRender, execution_mode: ExecutionMode = ExecutionMode.SYNC) -> None
QslJobParameterRender
dataclass
Bases: QslJobParameter
A runner to be rendered as an image
Source code in src/qgis_server_light/interface/job/render/input.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | |
bbox: BBox = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
crs: str = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
dpi: int | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
format: str = field(default='image/png', metadata={'type': 'Element'})
class-attribute
instance-attribute
height: int = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
layers: list[QslJobLayer] = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
width: int = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
__init__(*, layers: list[QslJobLayer], bbox: BBox, crs: str, width: int, height: int, dpi: int | None = None, format: str = 'image/png') -> None
get_layer_by_name(name: str) -> QslJobLayer
Source code in src/qgis_server_light/interface/job/render/input.py
23 24 25 26 27 | |
output
worker
info
This part defines the structure how a running QSL worker exposes its capabilities.
EngineInfo
dataclass
Source code in src/qgis_server_light/interface/worker/info.py
33 34 35 36 37 38 | |
id: str = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
qgis_info: QgisInfo = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
started: float = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
status: Status = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
__init__(id: str, qgis_info: QgisInfo, status: Status, started: float) -> None
QgisInfo
dataclass
Information container to ship minimal knowledge of the underlying QGIS.
Attributes:
-
version(int) –The integer representation of the QGIS version e.g. 34400
-
version_name(str) –The string representation which also includes the codename e.g. "QGIS Version 4.0.0-Norrköping"
Source code in src/qgis_server_light/interface/worker/info.py
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | |
path: str = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
version: int = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
version_name: str = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
__init__(version: int, version_name: str, path: str) -> None
Status
Bases: StrEnum
Source code in src/qgis_server_light/interface/worker/info.py
8 9 10 11 12 | |