qgis_server_light
qgis_server_light
debug
profile
profile_async(func)
A profiler which can be used as a decorator on ASYNC methods to produce profiles and call graphs.
The Callgraph might be inspected with QCacheGrind or KCacheGrind or sth. else.
Parameters:
-
func–the wrapped method
Returns:
-
–
The wrapper
Source code in src/qgis_server_light/debug/profile.py
5 6 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 | |
profile_sync(func)
A profiler which can be used as a decorator on SYNC methods to produce profiles and call graphs.
The Callgraph might be inspected with QCacheGrind or KCacheGrind or sth. else.
Parameters:
-
func–the wrapped method
Returns:
-
–
The wrapper
Source code in src/qgis_server_light/debug/profile.py
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 | |
exporter
api
allowed_extensions = ('qgz', 'qgs')
module-attribute
allowed_output_formats = ('json', 'xml')
module-attribute
app = Flask(__name__)
module-attribute
data_path = os.environ.get('QSL_DATA_ROOT', None)
module-attribute
exporter_host = os.environ.get('QSL_EXPORTER_API_HOST', '127.0.0.1')
module-attribute
exporter_port = int(os.environ.get('QSL_EXPORTER_API_PORT', 5000))
module-attribute
qgs = QgsApplication([], False)
module-attribute
api_export()
Source code in src/qgis_server_light/exporter/api.py
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 | |
cli
allowed_extensions = ('qgz', 'qgs')
module-attribute
allowed_output_formats = ('json', 'xml')
module-attribute
qgs = QgsApplication([], False)
module-attribute
cli() -> None
Just the central cli entry command. Currently, we don't use it, but its here for future content.
Source code in src/qgis_server_light/exporter/cli.py
21 22 23 24 25 26 27 28 | |
export(project: str, unify_layer_names_by_group: bool = False, output_format: str | None = None, pg_service_conf: str | None = None) -> None
Source code in src/qgis_server_light/exporter/cli.py
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 | |
common
create_full_pg_service_conf(pg_service_conf: str | None = None) -> dict
Source code in src/qgis_server_light/exporter/common.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 | |
extract
Exporter
Source code in src/qgis_server_light/exporter/extract.py
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 107 108 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 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 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 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 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 272 273 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 302 303 304 305 306 307 308 309 310 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 340 341 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 386 387 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 423 424 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 493 494 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 572 573 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 608 609 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 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 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 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 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 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 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 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 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 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 | |
path = qgis_project_path
instance-attribute
pg_service_configs = pg_service_configs or {}
instance-attribute
qgis_project = self.open_qgis_project(qgis_project_path)
instance-attribute
qgis_project_tree_root = self.qgis_project.layerTreeRoot()
instance-attribute
qsl_config = Config(project=(self.qsl_project), meta_data=(self.qsl_project_metadata), tree=(self.qsl_tree), datasets=(self.qsl_datasets))
instance-attribute
qsl_datasets = Datasets()
instance-attribute
qsl_project = Project(name=(self.assembled_name), version=(self.version))
instance-attribute
qsl_project_metadata = self.extract_metadata(self.qgis_project)
instance-attribute
qsl_tree = Tree()
instance-attribute
unify_layer_names_by_group = unify_layer_names_by_group
instance-attribute
unify_layer_names_by_group_separator = unify_layer_names_by_group_separator
instance-attribute
__init__(qgis_project_path: str, unify_layer_names_by_group=False, unify_layer_names_by_group_separator='.', pg_service_configs=None)
Source code in src/qgis_server_light/exporter/extract.py
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 | |
create_qsl_bbox_from_qgis_rectangle_extent(extent: QgsRectangle) -> BBox
staticmethod
Source code in src/qgis_server_light/exporter/extract.py
785 786 787 788 789 790 791 792 | |
create_qsl_bbox_from_qgis_rectangle_wgs84(project: QgsProject, layer: QgsMapLayer, extent: QgsRectangle) -> BBox
staticmethod
Reprojects the job_layer_definition's extent using WGS84.
Parameters:
-
project(QgsProject) –The QGIS project instance for projection context.
-
layer(QgsMapLayer) –The job_layer_definition which for the projection context.
-
extent(QgsRectangle) –The extent which will be reprojected.
Returns:
-
BBox–The QSL bbox reprojected to WGS84.
Source code in src/qgis_server_light/exporter/extract.py
766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 | |
create_qsl_crs_from_qgs_layer(layer: QgsMapLayer) -> Crs
staticmethod
Translates the QGIS job_layer_definition crs information into an instance of the QGIS-Server-Light interface Crs instance.
Parameters:
-
layer(QgsMapLayer) –The job_layer_definition to take the crs information from.
Returns:
-
Crs–The instance of the QSL interface Crs.
Source code in src/qgis_server_light/exporter/extract.py
712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 | |
create_qsl_field_from_qgis_field(field: QgsField, is_primary_key: bool) -> Field
staticmethod
Source code in src/qgis_server_light/exporter/extract.py
370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 | |
create_qsl_fields_from_qgis_field(layer: QgsVectorLayer) -> List[Field]
staticmethod
Source code in src/qgis_server_light/exporter/extract.py
428 429 430 431 432 433 434 435 436 437 438 | |
create_qsl_source_gdal(datasource: dict) -> GdalSource
staticmethod
Source code in src/qgis_server_light/exporter/extract.py
637 638 639 | |
create_qsl_source_ogr(datasource: dict) -> OgrSource
staticmethod
Source code in src/qgis_server_light/exporter/extract.py
641 642 643 | |
create_qsl_source_postgresql(datasource: dict) -> PostgresSource
Source code in src/qgis_server_light/exporter/extract.py
645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 | |
create_qsl_source_vector_tiles(datasource: dict) -> VectorTileSource
staticmethod
Source code in src/qgis_server_light/exporter/extract.py
625 626 627 | |
create_qsl_source_wms(datasource: dict) -> WmsSource
staticmethod
Source code in src/qgis_server_light/exporter/extract.py
621 622 623 | |
create_qsl_source_wmts(datasource: dict) -> WmtsSource
staticmethod
Source code in src/qgis_server_light/exporter/extract.py
633 634 635 | |
create_qsl_source_xyz(datasource: dict) -> XYZSource
staticmethod
Source code in src/qgis_server_light/exporter/extract.py
629 630 631 | |
create_style_list(qgs_layer: QgsMapLayer) -> List[Style]
staticmethod
Source code in src/qgis_server_light/exporter/extract.py
944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 | |
create_unified_short_name(short_name: str, path: list[str])
Creates the unified short name, separated by the configured separator.
Parameters:
-
short_name(str) –The short name either of the group or the job_layer_definition.
-
path(list[str]) –The path is a list of string which stores the information of the current tree path. This is used to construct a string for unifying job_layer_definition names by their tree path.
Returns:
Source code in src/qgis_server_light/exporter/extract.py
327 328 329 330 331 332 333 334 335 336 337 338 339 340 | |
decide_sslmode(ssl_mode: int) -> str
staticmethod
Mapper to map ssl modes from QGIS to plain postgres.
Parameters:
-
ssl_mode(int) –The ssl mode of the datasource.
Returns:
-
str–The string representation of the ssl mode as it is used by postgres connections.
Source code in src/qgis_server_light/exporter/extract.py
699 700 701 702 703 704 705 706 707 708 709 710 | |
decode_datasource(layer: QgsMapLayer) -> dict
Decodes a QGIS map job_layer_definition datasource into a dict and ensures that types are pythonic and pathes are clean for further usage.
Parameters:
-
layer(QgsMapLayer) –The job_layer_definition which the datasource should be extracted from.
Returns:
-
dict–The decoded and cleaned datasource.
Source code in src/qgis_server_light/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 | |
extract_group(group: QgsLayerTreeGroup, path: list[str])
Collects data pertaining to a QGIS job_layer_definition tree group. Basically this translates a QgsLayerTreeGroup into a QGIS-Server-Light TreeGroup.
Parameters:
-
group(QgsLayerTreeGroup) –The group which is handled.
-
path(list[str]) –The path is a list of string which stores the information of the current tree path. This is used to construct a string for unifying job_layer_definition names by their tree path.
Source code in src/qgis_server_light/exporter/extract.py
142 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 | |
extract_metadata(project: QgsProject) -> MetaData
staticmethod
Creates a QSL interface instance for metadate pulled out of the QGIS project.
Parameters:
-
project(QgsProject) –The instantiated QGIS project.
Returns:
-
MetaData–The metadata interface instance.
Source code in src/qgis_server_light/exporter/extract.py
856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 | |
extract_save_layer(child: QgsLayerTreeLayer, path: list[str], types_from_editor_widget: bool = False)
Save the given job_layer_definition to the output path.
Source code in src/qgis_server_light/exporter/extract.py
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 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 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 272 273 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 302 303 304 305 306 307 308 | |
get_group_short_name(group: QgsLayerTreeGroup) -> str
staticmethod
Source code in src/qgis_server_light/exporter/extract.py
489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 | |
get_group_title(group: QgsLayerTreeGroup) -> str
staticmethod
Source code in src/qgis_server_light/exporter/extract.py
477 478 479 480 481 482 483 484 485 486 487 | |
get_layer_short_name(layer: QgsLayerTreeLayer) -> str
staticmethod
This method determines which name is used as the short name of the job_layer_definition.
Parameters:
-
layer(QgsLayerTreeLayer) –The job_layer_definition which the short name should be derived from.
Returns:
-
str–The short name.
Source code in src/qgis_server_light/exporter/extract.py
732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 | |
get_layer_type(layer: QgsMapLayer) -> str | None
staticmethod
Gets the type of the given Qgis job_layer_definition as a string if the type is supported. This is to flatten the understanding of layers from qgis into something we can handle.
Parameters:
-
layer(QgsMapLayer) –The job_layer_definition to decide the type for.
Returns:
-
str | None–"raster", "vector" or "custom" if a job_layer_definition matched and None otherwise.
Source code in src/qgis_server_light/exporter/extract.py
794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 | |
get_project_server_entries(project, scope_or_scopes: Union[str, list]) -> dict
staticmethod
Gets values from the fields displayed in QGIS under Project > Properties > Server.
Returns a Dictionary holding all pairs of
Source code in src/qgis_server_light/exporter/extract.py
879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 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 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 | |
make_wgs84_geom_transform(project, layer) -> QgsCoordinateTransform
staticmethod
Creates a QgisCoordinateTransform context to transform a job_layer_definition to EPSG:4326 aka wgs84.
Parameters:
-
project–The QGIS project instance.
-
layer–The job_layer_definition which's extent should be reprojected.
Returns:
-
QgsCoordinateTransform–The QGIS transformation context.
Source code in src/qgis_server_light/exporter/extract.py
750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 | |
merge_dicts(a, b)
staticmethod
Merges two dicts recursively, b values overwrites a values.
Parameters:
-
a–Dictionary which is the base.
-
b–Dictionary which is merged in and whose values overwrites the one.
Returns:
-
–
The merged dict.
Source code in src/qgis_server_light/exporter/extract.py
675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 | |
obtain_editor_widget_type_from_qgis_field(field: QgsField) -> Tuple[str, str, str, str] | Tuple[str, None, None, None]
staticmethod
We simply mimikri QGIS Server here
TODO: This could be improved alot! Maybe we can also backport that to QGIS core some day?
Parameters:
-
field(QgsField) –The field of an
QgsVectorLayer.
Returns:
-
Tuple[str, str, str, str] | Tuple[str, None, None, None]–Unified type name regarding
-
Tuple[str, str, str, str] | Tuple[str, None, None, None]–
Source code in src/qgis_server_light/exporter/extract.py
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 572 573 574 575 576 577 578 579 580 581 | |
obtain_nullable(field: QgsField)
staticmethod
Source code in src/qgis_server_light/exporter/extract.py
403 404 405 406 407 408 409 410 | |
obtain_simple_types_from_qgis_field_json(field: QgsField) -> Tuple[str, str] | Tuple[str, None]
staticmethod
Delivers the type match for json based on the field QgsField type.
Parameters:
-
field(QgsField) –The field of an
QgsVectorLayer.
Returns:
-
Tuple[str, str] | Tuple[str, None]–Unified type name and format in a tuple.
Source code in src/qgis_server_light/exporter/extract.py
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 608 609 610 611 612 613 614 615 616 617 618 619 | |
obtain_simple_types_from_qgis_field_xml(field: QgsField) -> str
staticmethod
Parameters:
-
field(QgsField) –The field of an
QgsVectorLayer.
Returns:
-
str–Unified type name regarding
-
str– -
IMPORTANT(str) –If type is not matched within the function it will be
stringalways!
Source code in src/qgis_server_light/exporter/extract.py
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 | |
open_qgis_project(path_to_project: str) -> QgsProject
staticmethod
Parameters:
-
path_to_project(str) –The absolute path on the file system where the project can be read from.
Returns:
-
QgsProject–The opened project (read).
Source code in src/qgis_server_light/exporter/extract.py
821 822 823 824 825 826 827 828 829 830 831 832 833 834 | |
prepare_qgis_project_name(project: QgsProject) -> tuple[str, str]
staticmethod
Parameters:
-
project(QgsProject) –The instantiated QGIS project.
Returns:
-
tuple[str, str]–Tuple of str version, name
Source code in src/qgis_server_light/exporter/extract.py
836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 | |
provide_field_length(field: QgsField) -> int | None
staticmethod
Source code in src/qgis_server_light/exporter/extract.py
412 413 414 415 416 417 418 | |
provide_field_precision(field: QgsField) -> int | None
staticmethod
Source code in src/qgis_server_light/exporter/extract.py
420 421 422 423 424 425 426 | |
run() -> Config
Source code in src/qgis_server_light/exporter/extract.py
96 97 98 | |
sanitize_name(raw: str, lower: bool = False) -> str
staticmethod
Transforms an arbitrary string into a WMS/WFS and URL compatible short name for a job_layer_definition or group.
Steps: 1. Unicode‑NFD → ASCII‑transliteration (removes umlauts/diacritics). 2. All chars, which are NOT [A‑Za‑z0‑9_.‑], will be replaced by '' ersetzen. 3. Reduce multiple underscore '' to a single one. 4. Remove leading '', '.', '-'. 5. If the string is empty OR does not start with a letter OR not start with '', a leading '_' will be added. 6. Optional all will be converted to lowercase (lower=True).
Source code in src/qgis_server_light/exporter/extract.py
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 | |
short_name(short_name: str, path: list[str]) -> str
Decides if to use the short name itself or the unified version by the tree path.
Parameters:
-
short_name(str) –The short name either of the group or the job_layer_definition.
-
path(list[str]) –The path is a list of string which stores the information of the current tree path. This is used to construct a string for unifying job_layer_definition names by their tree path.
Returns:
-
str–The short name itself or its unified tree path.
Source code in src/qgis_server_light/exporter/extract.py
310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 | |
walk_qgis_project_tree(entity: QgsLayerTreeNode, path: list[str])
This is a highly recursive function which walks to the qgis job_layer_definition tree to extract all knowledge out of it. It is called from itself again for each level of group like elements which are found.
Parameters:
-
entity(QgsLayerTreeNode) –The QGIS projects tree node which can be a QgsLayerTree, QgsLayerTreeGroup or QgsLayerTreeLayer.
-
path(list[str]) –The path is a list of string which stores the information of the current tree path. This is used to construct a string for unifying job_layer_definition names by their tree path.
Source code in src/qgis_server_light/exporter/extract.py
100 101 102 103 104 105 106 107 108 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 | |
interface
common
This module contains common logic, shared beyond all specialized parts of the QGIS-Server-Light interface.
BBox
dataclass
Bases: BaseInterface
Source code in src/qgis_server_light/interface/common.py
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 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 | |
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
219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 | |
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
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 | |
to_2d_list() -> list
Source code in src/qgis_server_light/interface/common.py
186 187 | |
to_2d_string() -> str
Source code in src/qgis_server_light/interface/common.py
189 190 | |
to_list() -> list
Source code in src/qgis_server_light/interface/common.py
180 181 | |
to_string() -> str
Source code in src/qgis_server_light/interface/common.py
183 184 | |
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
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 | |
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
80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 | |
PgServiceConf
dataclass
Bases: BaseInterface
A typed definition of the pg_service.conf definition which might be used.
Source code in src/qgis_server_light/interface/common.py
145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 | |
application_name: str | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
client_encoding: str = field(default='UTF8', metadata={'type': 'Element'})
class-attribute
instance-attribute
dbname: 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
name: 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
service: str | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
sslmode: SslMode = field(default=(SslMode.PREFER), metadata={'type': 'Element'})
class-attribute
instance-attribute
user: str | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
__init__(name: str, host: str | None = None, port: int | None = None, user: str | None = None, dbname: str | None = None, password: str | None = None, sslmode: SslMode = SslMode.PREFER, application_name: str | None = None, client_encoding: str = 'UTF8', service: str | None = None) -> 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
103 104 105 106 107 108 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 | |
__format__(format_spec)
Source code in src/qgis_server_light/interface/common.py
119 120 | |
__init__(value, redacted_text='**REDACTED**')
Source code in src/qgis_server_light/interface/common.py
109 110 111 | |
__json__()
Source code in src/qgis_server_light/interface/common.py
122 123 | |
__repr__()
Source code in src/qgis_server_light/interface/common.py
116 117 | |
__str__()
Source code in src/qgis_server_light/interface/common.py
113 114 | |
reveal()
Allows access to the original value when necessary.
Returns:
-
–
The secret string.
Source code in src/qgis_server_light/interface/common.py
125 126 127 128 129 130 131 132 133 | |
SslMode
Bases: str, Enum
Source code in src/qgis_server_light/interface/common.py
136 137 138 139 140 141 142 | |
ALLOW = 'allow'
class-attribute
instance-attribute
DISABLE = 'disable'
class-attribute
instance-attribute
PREFER = 'prefer'
class-attribute
instance-attribute
REQUIRE = 'require'
class-attribute
instance-attribute
VERIFY_CA = 'verify-ca'
class-attribute
instance-attribute
VERIFY_FULL = 'verify-full'
class-attribute
instance-attribute
Style
dataclass
Bases: BaseInterface
Source code in src/qgis_server_light/interface/common.py
246 247 248 249 250 251 252 253 | |
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
Status
Bases: Enum
Source code in src/qgis_server_light/interface/dispatcher/common.py
4 5 6 7 8 | |
FAILURE = 'failed'
class-attribute
instance-attribute
QUEUED = 'queued'
class-attribute
instance-attribute
RUNNING = 'running'
class-attribute
instance-attribute
SUCCESS = 'succeed'
class-attribute
instance-attribute
redis_asio
This contains the interface definition about how a job info is passed around a redis queue.
RedisQueue
Source code in src/qgis_server_light/interface/dispatcher/redis_asio.py
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 107 108 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 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 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 | |
client = redis_client
instance-attribute
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 = 'jobs'
class-attribute
instance-attribute
job_status_key: str = 'status'
class-attribute
instance-attribute
job_timestamp_key: str = 'timestamp'
class-attribute
instance-attribute
__init__(redis_client: redis_aio.Redis) -> None
Source code in src/qgis_server_light/interface/dispatcher/redis_asio.py
48 49 50 51 52 53 | |
create(url: str)
classmethod
Source code in src/qgis_server_light/interface/dispatcher/redis_asio.py
55 56 57 58 | |
post(job_parameter: QslJobParameterRender | QslJobParameterFeatureInfo | QslJobParameterLegend | QslJobParameterFeature, to: float = 10.0) -> tuple[JobResult, str]
async
Posts a new runner to the runner queue and waits maximum timeout seconds to complete.
Will return a JobResult if successful or raise an error.
Parameters:
-
job_parameter(QslJobParameterRender | QslJobParameterFeatureInfo | QslJobParameterLegend | QslJobParameterFeature) –The parameter for the job which should be executed.
-
to(float, default:10.0) –The timeout a job is expected to be waited for before canceling job execution.
Source code in src/qgis_server_light/interface/dispatcher/redis_asio.py
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 107 108 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 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 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 | |
set_job_runtime_status(job_id, pipeline: Pipeline, status: str, start_time: float)
async
Source code in src/qgis_server_light/interface/dispatcher/redis_asio.py
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 | |
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
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 | |
mandant: str = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
output_format: str = field(metadata={'type': 'Element'}, default='json')
class-attribute
instance-attribute
pg_service_configs: list[PgServiceConf] = field(metadata={'type': 'Element'}, default_factory=list)
class-attribute
instance-attribute
pg_service_configs_dict: dict
property
project: 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__(mandant: str, project: str, unify_layer_names_by_group: bool = False, output_format: str = 'json', pg_service_configs: list[PgServiceConf] = list()) -> 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
42 43 44 45 46 47 48 | |
successful: bool = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
__init__(successful: bool) -> 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
92 93 94 | |
title: str = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
__init__(id: str, name: str, title: str) -> None
Config
dataclass
Bases: BaseInterface
Source code in src/qgis_server_light/interface/exporter/extract.py
635 636 637 638 639 640 | |
datasets: Datasets = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
meta_data: MetaData = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
project: Project = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
tree: Tree = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
__init__(project: Project, meta_data: MetaData, tree: Tree, datasets: Datasets) -> None
Crs
dataclass
Bases: BaseInterface
Source code in src/qgis_server_light/interface/exporter/extract.py
97 98 99 100 101 102 103 104 105 | |
auth_id: str = field(default=None, 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) -> None
Custom
dataclass
Bases: DataSet
Source code in src/qgis_server_light/interface/exporter/extract.py
523 524 525 | |
__init__(id: str, name: str, 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) -> None
DataSet
dataclass
Bases: AbstractDataset
Source code in src/qgis_server_light/interface/exporter/extract.py
465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 | |
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_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, 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) -> None
get_style_by_name(name: str) -> Style | None
Source code in src/qgis_server_light/interface/exporter/extract.py
478 479 480 481 482 | |
style() -> Style | None
Source code in src/qgis_server_light/interface/exporter/extract.py
484 485 | |
DataSource
dataclass
Bases: BaseInterface
Source code in src/qgis_server_light/interface/exporter/extract.py
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 | |
definition: PostgresSource | WmtsSource | WmsSource | OgrSource | GdalSource | WfsSource | VectorTileSource | XYZSource | 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
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) -> None
Datasets
dataclass
Bases: BaseInterface
Source code in src/qgis_server_light/interface/exporter/extract.py
615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 | |
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
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.
-
type_wfs(Optional[str]) –Translated type for further usage. Based on the simple types of XSD spec.
-
type_oapif(Optional[str]) –Translated type based on the types of the OpenAPI Spec
-
type_oapif_format(Optional[str]) –Format of the above-mentioned type based on the OpenAPI Spec
-
alias(Optional[str]) –Human readable name.
-
comment(Optional[str]) –Field description.
-
nullable(bool) –If this field can be NULL or not.
-
length(Optional[int]) –The limitation in length on the field value.
-
precision(Optional[int]) –The precision of the field value (float types)
-
editor_widget_type(Optional[str]) –The original type how it is defined in the QGIS form.
-
editor_widget_type_wfs(Optional[str]) –The translated type based on the simple types of XSD spec.
-
editor_widget_type_oapif(Optional[str]) –Translated type based on the types of the OpenAPI Spec
-
editor_widget_type_oapif_format(Optional[str]) –Format of the above-mentioned type based on the OpenAPI Spec
Source code in src/qgis_server_light/interface/exporter/extract.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 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 | |
alias: Optional[str] = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
comment: Optional[str] = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
editor_widget_type: Optional[str] = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
editor_widget_type_oapif: Optional[str] = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
editor_widget_type_oapif_format: Optional[str] = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
editor_widget_type_wfs: Optional[str] = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
is_primary_key: bool = field(default=False, metadata={'type': 'Element'})
class-attribute
instance-attribute
length: Optional[int] = 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: Optional[int] = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
type: str = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
type_oapif: Optional[str] = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
type_oapif_format: Optional[str] = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
type_wfs: Optional[str] = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
__init__(name: str, type: str, is_primary_key: bool = False, type_wfs: Optional[str] = None, type_oapif: Optional[str] = None, type_oapif_format: Optional[str] = None, alias: Optional[str] = None, comment: Optional[str] = None, nullable: bool = True, length: Optional[int] = None, precision: Optional[int] = None, editor_widget_type: Optional[str] = None, editor_widget_type_wfs: Optional[str] = None, editor_widget_type_oapif: Optional[str] = None, editor_widget_type_oapif_format: Optional[str] = None) -> None
GdalSource
dataclass
Bases: Source
Source code in src/qgis_server_light/interface/exporter/extract.py
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 | |
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
146 147 148 149 150 151 152 | |
Group
dataclass
Bases: AbstractDataset
Source code in src/qgis_server_light/interface/exporter/extract.py
528 529 530 | |
__init__(id: str, name: str, title: str) -> None
LayerLike
dataclass
Bases: BaseInterface
Source code in src/qgis_server_light/interface/exporter/extract.py
15 16 17 18 | |
id: str = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
name: str = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
__init__(id: str, name: str) -> None
MetaData
dataclass
Bases: BaseInterface
Source code in src/qgis_server_light/interface/exporter/extract.py
569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 | |
author: Optional[str] = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
categories: Optional[List[str]] = field(default_factory=list, metadata={'type': 'Element'})
class-attribute
instance-attribute
creationDateTime: str = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
language: Optional[str] = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
links: Optional[List[str]] = 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: Optional[List[str]] = list(), language: Optional[str] = None, categories: Optional[List[str]] = list(), creationDateTime: str = None, author: Optional[str] = None) -> None
__post_init__()
Source code in src/qgis_server_light/interface/exporter/extract.py
590 591 592 | |
OgrSource
dataclass
Bases: GdalSource
Source code in src/qgis_server_light/interface/exporter/extract.py
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 | |
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
169 170 171 172 173 174 175 176 177 178 | |
PostgresSource
dataclass
Bases: Source
Source code in src/qgis_server_light/interface/exporter/extract.py
308 309 310 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 340 341 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 386 387 388 | |
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 = field(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, schema: str, table: str, 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
362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 | |
Project
dataclass
Bases: BaseInterface
Source code in src/qgis_server_light/interface/exporter/extract.py
595 596 597 598 | |
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
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
488 489 490 491 492 493 | |
__init__(id: str, name: str, 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) -> None
Service
dataclass
Bases: BaseInterface
Source code in src/qgis_server_light/interface/exporter/extract.py
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 | |
contact_mail: Optional[str] = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
contact_organization: Optional[str] = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
contact_person: Optional[str] = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
contact_phone: Optional[str] = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
contact_position: Optional[str] = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
fees: Optional[str] = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
keyword_list: Optional[str] = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
online_resource: Optional[str] = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
resource_url: Optional[str] = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
service_abstract: Optional[str] = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
service_title: Optional[str] = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
__init__(contact_organization: Optional[str], contact_mail: Optional[str], contact_person: Optional[str] = None, contact_phone: Optional[str] = None, contact_position: Optional[str] = None, fees: Optional[str] = None, keyword_list: Optional[str] = None, online_resource: Optional[str] = None, service_abstract: Optional[str] = None, service_title: Optional[str] = None, resource_url: Optional[str] = None) -> None
Source
dataclass
Bases: BaseInterface, ABC
Source code in src/qgis_server_light/interface/exporter/extract.py
108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 | |
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
110 111 112 | |
from_qgis_decoded_uri(decoded_uri: dict)
classmethod
Source code in src/qgis_server_light/interface/exporter/extract.py
120 121 122 123 124 | |
Tree
dataclass
Bases: BaseInterface
Source code in src/qgis_server_light/interface/exporter/extract.py
601 602 603 604 605 606 607 608 609 610 611 612 | |
members: list[TreeGroup] = field(default_factory=list, metadata={'type': 'Element'})
class-attribute
instance-attribute
__init__(members: list[TreeGroup] = list()) -> None
find_by_name(name: str) -> TreeGroup | None
Source code in src/qgis_server_light/interface/exporter/extract.py
608 609 610 611 612 | |
TreeGroup
dataclass
Bases: TreeLayer
Source code in src/qgis_server_light/interface/exporter/extract.py
26 27 28 29 30 31 | |
children: List[str] = field(default_factory=list, metadata={'type': 'Element'})
class-attribute
instance-attribute
__init__(id: str, name: str, children: List[str] = list()) -> None
TreeLayer
dataclass
Bases: LayerLike
Source code in src/qgis_server_light/interface/exporter/extract.py
21 22 23 | |
__init__(id: str, name: str) -> 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
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 | |
fields: Optional[List[Field]] = field(default_factory=list, metadata={'type': 'Element'})
class-attribute
instance-attribute
geometry_type_simple: Optional[str] = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
geometry_type_wkb: Optional[str] = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
__init__(id: str, name: str, 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, fields: Optional[List[Field]] = list(), geometry_type_simple: Optional[str] = None, geometry_type_wkb: Optional[str] = None) -> None
get_field_by_name(name: str) -> Field | None
Source code in src/qgis_server_light/interface/exporter/extract.py
516 517 518 519 520 | |
VectorTileSource
dataclass
Bases: Source
Source code in src/qgis_server_light/interface/exporter/extract.py
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 423 424 | |
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
415 416 417 418 419 420 421 422 423 424 | |
WfsSource
dataclass
Bases: BaseInterface
Source code in src/qgis_server_light/interface/exporter/extract.py
185 186 187 188 189 | |
__init__() -> None
WmsSource
dataclass
Bases: Source
Source code in src/qgis_server_light/interface/exporter/extract.py
223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 | |
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
253 254 255 256 257 258 259 260 261 262 263 264 | |
WmtsSource
dataclass
Bases: WmsSource
Source code in src/qgis_server_light/interface/exporter/extract.py
271 272 273 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 302 303 304 305 | |
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
290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 | |
XYZSource
dataclass
Bases: Source
Source code in src/qgis_server_light/interface/exporter/extract.py
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 220 | |
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
209 210 211 212 213 214 215 216 | |
job
common
input
AbstractFilter
dataclass
Bases: BaseInterface
Source code in src/qgis_server_light/interface/job/common/input.py
48 49 50 51 52 53 54 | |
definition: str = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
shortened_fields: set
property
__init__(definition: str) -> None
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
57 58 59 60 61 62 63 | |
__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
66 67 68 69 70 71 | |
__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.
Source code in src/qgis_server_light/interface/job/common/input.py
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | |
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) -> None
QslJobLayer
dataclass
Bases: BaseInterface
Source code in src/qgis_server_light/interface/job/common/input.py
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 | |
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
7 8 9 10 11 12 13 | |
__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
36 37 38 39 40 41 42 43 44 45 | |
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
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 list of datasets.
-
filter(OgcFilterFES20) –An optional filter which might reference all passed layers thats why layers has to be added
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 | |
aliases: list[str] = field(default_factory=list, 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) -> None
QslJobInfoFeature
dataclass
Bases: QslJobInfoParameter
Source code in src/qgis_server_light/interface/job/feature/input.py
56 57 58 | |
job: QslJobParameterFeature = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
__init__(id: str, type: str, job: QslJobParameterFeature) -> 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
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 | |
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
39 40 41 42 43 44 45 46 47 48 49 50 51 52 | |
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
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 | |
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 35 36 | |
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
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 | |
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
44 45 46 47 48 | |
job: QslJobParameterFeatureInfo = field(metadata={'type': 'Element', 'required': True})
class-attribute
instance-attribute
__init__(id: str, type: str, job: QslJobParameterFeatureInfo) -> 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 40 41 | |
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 28 29 | |
output
legend
input
QslJobInfoLegend
dataclass
Bases: QslJobInfoParameter
Source code in src/qgis_server_light/interface/job/legend/input.py
14 15 16 | |
job: QslJobParameterLegend = field(metadata={'type': 'Element', 'required': True})
class-attribute
instance-attribute
__init__(id: str, type: str, job: QslJobParameterLegend) -> None
QslJobParameterLegend
dataclass
Bases: QslJobParameter
Render legend
Source code in src/qgis_server_light/interface/job/legend/input.py
9 10 11 | |
__init__() -> None
output
process
input
output
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) -> 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: str, Enum
Source code in src/qgis_server_light/interface/worker/info.py
8 9 10 11 12 | |
CRASHED = 'crashed'
class-attribute
instance-attribute
PROCESSING = 'processing'
class-attribute
instance-attribute
STARTING = 'starting'
class-attribute
instance-attribute
WAITING = 'waiting'
class-attribute
instance-attribute
mappers
factory
Factory
Bases: ABC
Source code in src/qgis_server_light/mappers/factory.py
4 5 6 7 8 9 | |
from_dataclass()
Source code in src/qgis_server_light/mappers/factory.py
5 6 | |
to_dataclass()
Source code in src/qgis_server_light/mappers/factory.py
8 9 | |
worker
engine
Engine
Bases: ABC
Source code in src/qgis_server_light/worker/engine.py
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 107 108 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 141 142 | |
available_job_info_classes: dict[str, Type[QslJobInfoParameter]] = {}
instance-attribute
available_runner_classes: dict[str, Type[Runner]] = {}
instance-attribute
available_runner_classes_by_job_info: dict[str, Type[Runner]] = {}
instance-attribute
context = context
instance-attribute
info = self._initialize_infos()
instance-attribute
layer_cache: dict[Any, Any] = {}
instance-attribute
qgis = Qgis(svg_paths, log_level)
instance-attribute
status
property
__del__()
Source code in src/qgis_server_light/worker/engine.py
48 49 | |
__init__(context: EngineContext, runner_plugins: list[str], svg_paths: Optional[List[str]] = None, log_level=logging.WARNING)
Source code in src/qgis_server_light/worker/engine.py
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | |
process(job_info: QslJobInfoParameter) -> JobResult
Source code in src/qgis_server_light/worker/engine.py
121 122 123 124 125 126 127 128 129 | |
runner_plugin_by_job_info(job_info: QslJobInfoParameter) -> Type[Runner]
Here we decide which plugin we load dynamically out of the available ones.
Parameters:
-
job_info(QslJobInfoParameter) –Is the parameter instance we check the available worker classes and there the job_info_class at each.
Returns:
-
Type[Runner]–The selected runner class
Source code in src/qgis_server_light/worker/engine.py
103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 | |
set_crashed()
Source code in src/qgis_server_light/worker/engine.py
138 139 | |
set_processing()
Source code in src/qgis_server_light/worker/engine.py
141 142 | |
set_waiting()
Source code in src/qgis_server_light/worker/engine.py
135 136 | |
EngineContext
dataclass
Source code in src/qgis_server_light/worker/engine.py
23 24 25 | |
base_path: Union[str, pathlib.Path]
instance-attribute
__init__(base_path: Union[str, pathlib.Path]) -> None
image_utils
qgis
CredentialsHelper
Bases: QgsCredentials
Source code in src/qgis_server_light/worker/qgis.py
9 10 11 12 13 14 15 16 17 18 19 | |
__init__()
Source code in src/qgis_server_light/worker/qgis.py
10 11 12 | |
request(realm, username, password, message)
Source code in src/qgis_server_light/worker/qgis.py
14 15 16 | |
requestMasterPassword(password, stored)
Source code in src/qgis_server_light/worker/qgis.py
18 19 | |
Qgis(svg_paths: Optional[List[str]], log_level)
Source code in src/qgis_server_light/worker/qgis.py
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | |
version() -> int
Source code in src/qgis_server_light/worker/qgis.py
47 48 | |
version_name() -> str
Source code in src/qgis_server_light/worker/qgis.py
51 52 | |
qgis_type_serializer
QDateConverter
Bases: Converter
Source code in src/qgis_server_light/worker/qgis_type_serializer.py
10 11 12 13 14 15 16 17 18 19 20 | |
format = 'yyyy-MM-dd'
class-attribute
instance-attribute
deserialize(value: str, **kwargs: Any) -> QDate
Source code in src/qgis_server_light/worker/qgis_type_serializer.py
13 14 | |
serialize(value: QDate, **kwargs: Any) -> Optional[str]
Source code in src/qgis_server_light/worker/qgis_type_serializer.py
16 17 18 19 20 | |
register_converters_at_runtime()
Source code in src/qgis_server_light/worker/qgis_type_serializer.py
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | |
redis
DEFAULT_DATA_ROOT = '/io/data'
module-attribute
DEFAULT_SVG_PATH = '/io/svg'
module-attribute
RedisEngine
Bases: Engine
Source code in src/qgis_server_light/worker/redis.py
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 107 108 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 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 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 | |
boot_start = time.time()
instance-attribute
info_expire: int = 300
instance-attribute
max_retries = 11
instance-attribute
retry_wait = 0.01
instance-attribute
shutdown = False
instance-attribute
__init__(context: EngineContext, runner_plugins: list[str], svg_paths: Optional[List] = None) -> None
Source code in src/qgis_server_light/worker/redis.py
28 29 30 31 32 33 34 35 36 37 38 39 | |
exit_connection_error()
staticmethod
Source code in src/qgis_server_light/worker/redis.py
49 50 51 52 | |
exit_gracefully(signum, frame)
Source code in src/qgis_server_light/worker/redis.py
54 55 56 57 | |
heartbeat(client: Redis) -> datetime.datetime
Source code in src/qgis_server_light/worker/redis.py
78 79 80 81 | |
register_worker(client: Redis)
Source code in src/qgis_server_light/worker/redis.py
83 84 85 86 87 88 89 90 91 92 93 | |
retry_connection(redis_url: str, count: int)
Source code in src/qgis_server_light/worker/redis.py
95 96 97 | |
retry_handling_with_jitter(count: int)
Source code in src/qgis_server_light/worker/redis.py
41 42 43 44 45 46 47 | |
run(redis_url)
Source code in src/qgis_server_light/worker/redis.py
119 120 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 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 | |
set_job_runtime_status(job_id: str, pipeline: Pipeline, status: str, start_time: float)
staticmethod
Source code in src/qgis_server_light/worker/redis.py
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 | |
start(redis_url) -> Redis
Source code in src/qgis_server_light/worker/redis.py
99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 | |
main() -> None
Source code in src/qgis_server_light/worker/redis.py
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 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 | |
runner
common
JobContext
dataclass
Source code in src/qgis_server_light/worker/runner/common.py
38 39 40 | |
base_path: str | Path
instance-attribute
__init__(base_path: str | Path) -> None
MapRunner
Bases: Runner
Base class for any runner that interacts with a map. Not runnable by itself.
Source code in src/qgis_server_light/worker/runner/common.py
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 107 108 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 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 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 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 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 272 273 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 302 303 304 305 306 307 308 309 310 311 312 313 314 315 | |
context = context
instance-attribute
custom_layer_drivers = ['xyzvectortiles', 'mbtilesvectortiles']
class-attribute
instance-attribute
default_style_name = 'default'
class-attribute
instance-attribute
job_info = job_info
instance-attribute
layer_cache = layer_cache
instance-attribute
map_layers: List[QgsMapLayer] = list()
instance-attribute
qgis = qgis
instance-attribute
raster_layer_drivers = ['gdal', 'wms', 'xyz', 'arcgismapserver', 'wcs']
class-attribute
instance-attribute
vector_layer_drivers = ['ogr', 'postgres', 'spatialite', 'mssql', 'oracle', 'wfs', 'delimitedtext', 'gpx', 'arcgisfeatureserver']
class-attribute
instance-attribute
__init__(qgis: QgsApplication, context: JobContext, job_info: QslJobInfoParameter, layer_cache: Optional[Dict] = None) -> None
Source code in src/qgis_server_light/worker/runner/common.py
92 93 94 95 96 97 98 99 100 101 102 103 | |
get_cache_name(job_layer_definition: QslJobLayer) -> str
Central method to decide which name is used in the cache to identify a layer.
Source code in src/qgis_server_light/worker/runner/common.py
146 147 148 149 150 | |
Runner
Bases: ABC
Source code in src/qgis_server_light/worker/runner/common.py
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 | |
job_info_class: Type[QslJobInfoParameter]
instance-attribute
__init__(qgis: QgsApplication, context: JobContext, job_info: QslJobInfoParameter, layer_cache: Optional[Dict])
Source code in src/qgis_server_light/worker/runner/common.py
46 47 48 49 50 51 52 53 54 | |
deserialize_job_info(job_info: bytes)
classmethod
Source code in src/qgis_server_light/worker/runner/common.py
60 61 62 | |
run()
Source code in src/qgis_server_light/worker/runner/common.py
56 57 58 | |
feature
GetFeatureRunner
Bases: MapRunner
Source code in src/qgis_server_light/worker/runner/feature.py
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 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 | |
job_info_class = QslJobInfoFeature
class-attribute
instance-attribute
__init__(qgis: QgsApplication, context: JobContext, job_info: QslJobInfoFeature, layer_cache: Optional[Dict] = None, layer_style_cache: Optional[set] = None) -> None
Source code in src/qgis_server_light/worker/runner/feature.py
32 33 34 35 36 37 38 39 40 | |
run()
Source code in src/qgis_server_light/worker/runner/feature.py
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 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 | |
feature_info
GetFeatureInfoRunner
Bases: MapRunner
Source code in src/qgis_server_light/worker/runner/feature_info.py
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 | |
job_info_class = QslJobInfoFeatureInfo
class-attribute
instance-attribute
__init__(qgis: QgsApplication, context: JobContext, job_info: QslJobInfoFeatureInfo, layer_cache: Optional[Dict] = None) -> None
Source code in src/qgis_server_light/worker/runner/feature_info.py
22 23 24 25 26 27 28 29 | |
run()
Source code in src/qgis_server_light/worker/runner/feature_info.py
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 | |
legend
GetLegendRunner
Bases: MapRunner
Source code in src/qgis_server_light/worker/runner/legend.py
5 6 7 8 9 10 11 | |
__init__(qgis, context: JobContext, job_info: QslJobInfoLegend) -> None
Source code in src/qgis_server_light/worker/runner/legend.py
6 7 | |
run()
Source code in src/qgis_server_light/worker/runner/legend.py
9 10 11 | |
process
ProcessRunner
Bases: MapRunner
Source code in src/qgis_server_light/worker/runner/process.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | |
__init__(qgis: QgsApplication, context: JobContext, job_info: QslJobInfoParameter, layer_cache: Optional[dict])
Source code in src/qgis_server_light/worker/runner/process.py
13 14 15 16 17 18 19 20 21 22 23 24 25 26 | |
load_providers(qgis: Qgis)
Source code in src/qgis_server_light/worker/runner/process.py
28 29 30 | |
render
RenderRunner
Bases: MapRunner
Responsible for rendering a QslRenderJob to an image.
Source code in src/qgis_server_light/worker/runner/render.py
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 | |
job_info_class = QslJobInfoRender
class-attribute
instance-attribute
__init__(qgis: QgsApplication, context: JobContext, job_info: QslJobInfoRender, layer_cache: Optional[Dict] = None) -> None
Source code in src/qgis_server_light/worker/runner/render.py
20 21 22 23 24 25 26 27 | |
image_formats()
classmethod
Source code in src/qgis_server_light/worker/runner/render.py
29 30 31 | |
run()
Run this runner. Returns: A JobResult with the content_type and image_data (bytes) of the rendered image.
Source code in src/qgis_server_light/worker/runner/render.py
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 | |