QGIS Knowledge Patch
Use this skill when changing QGIS projects, plugins, Processing workflows,
providers, QGIS Server deployments, cartography, layouts, elevation profiles,
or 3D and point-cloud workflows. Inspect the project's QGIS, Qt, GDAL, GEOS,
PDAL, SFCGAL, and provider versions before applying version-dependent advice.
How to use this skill
- Identify whether the task concerns desktop behavior, server behavior,
Processing, Python/C++ APIs, plugin metadata, or provider capabilities.
- Read the matching topic reference below. Consult more than one when a
workflow crosses boundaries, such as a plugin invoking Processing or a
server project backed by PostgreSQL.
- Check dependency gates explicitly. Several features require particular
GDAL, PDAL, wrench, SFCGAL, or GeoPandas versions.
- Preserve changed defaults deliberately when upgrading existing projects.
- Test provider- and rendering-dependent work against the actual data source,
because advertised service capabilities and build options affect behavior.
Reference index
| Reference |
Topics |
| Cartography, labeling, layouts, and profiles |
Symbols, labels, temporal display, print layouts, charts, forms, and elevation profiles |
| Data sources, databases, and server |
STAC, WMS/WFS/OAPIF, authentication, PostgreSQL, GeoPackage, SQL Server, and QGIS Server |
| Plugins, APIs, and user interface |
Plugin migration, PyQGIS/C++ APIs, expressions, themes, GPS, trust, menus, and settings |
| Processing, geometry, and raster |
Algorithms, digitizing, geometry engines, raster export, reprojection, and packaging |
| 3D, mesh, and point cloud |
3D scenes, materials, mesh, COPC/VPC, point-cloud editing, and profiles |
Breaking changes and migration traps
Declare QGIS 4 plugin compatibility with version bounds
Plugin compatibility is determined by qgisMinimumVersion and the optional
qgisMaximumVersion. If the maximum is absent, compatibility extends only to
the end of the minimum version's major line. A plugin retaining QGIS 3.22
support while declaring QGIS 4 compatibility can use:
[general]
qgisMinimumVersion=3.22
qgisMaximumVersion=4.99
The QGIS 4 Ready list accepts a plugin when either bound is at least 4.0.
Remove supportsQt6=True: QGIS no longer recognizes it. Before widening the
range, replace Qt 5-only APIs and direct PyQt5 imports with Qt 6 equivalents,
prefer qgis.PyQt, test under QGIS 4, and run pyqgis4-checker. Its Qt6 Check
findings identify files and lines but do not block upload or approval.
Target the separate QGIS 4 settings location
QGIS 4 settings are isolated from QGIS 3. First startup performs a one-time,
lossless copy of the loaded QGIS 3 profile, but later changes do not
synchronize. Update installation, profile-management, and enterprise scripts
to target the QGIS 4 location.
Account for changed server and layout defaults
- The QGIS Server OAPIF root is
/ogcapi, not /wfs3. Override it with
QGIS_SERVER_API_WFS3_ROOT_PATH when a deployment needs another path.
- New layout legends default to Visible Layers. Choose All Project Layers or
Manual Layer Selection when that is the intended contract; a global layout
setting can restore the earlier default.
- WMS service resolution for scale-aware raster extraction defaults to 96 DPI.
- Merge Vector Layers still enables source
layer and path fields by
default for backward compatibility.
Replace deprecated hub-distance algorithms
Use the C++ Hub Distance algorithm. It replaces Distance to Nearest Hub
(Points) and Distance to Nearest Hub (Line to Hub), exposes both optional
outputs, and leaves the older pair deprecated.
High-value workflow guidance
Make Cloud Optimized GeoTIFF intent explicit
When GDAL 3.13 or later is present, raster Save and Export dialogs can request
COG optimization and pyramids, and Processing can bulk-convert a directory.
For Processing outputs pass -of COG; the .tif or .tiff extension cannot
distinguish the COG and GTiff drivers.
Handle temporal raster and WMS behavior deliberately
Raster layers representing temporal values can accumulate pixels across time.
WMS-T groups can derive a recursive time dimension from children, and a fixed
raster date/time can define both temporal endpoints. Disabling time propagation
on a group prevents child dimensions from reaching its parent.
Use the expanded geometry APIs and engines
- PyQGIS exposes
QgsGeos directly.
QgsGeometry.as_numpy() preserves XY, XYZ, XYM, or XYZM dimensionality.
QgsGeometry.area3D() returns surface area for polygonal and surface types,
and zero for points and lines.
QgsVectorLayer.as_geopandas() creates a GeoPandas dataframe when GeoPandas
is installed.
- SFCGAL is available through
QgsSfcgalEngine and QgsSfcgalGeometry.
Choose OAPIF formats and paths intentionally
OGC API Features connections can select advertised formats, including GML and
bulk-download choices, rather than always using GeoJSON. The server exports
FlatGeobuf. Keep client format selection and the /ogcapi server root aligned
with deployment routing.
Use durable OAuth2 and cloud authentication
OAuth2 can attach extra token-endpoint values as HTTP headers and refresh
tokens automatically while connections remain in use. Authentication-manager
SAS signing supports Microsoft Planetary Computer, while Pro GeoCatalogs can
use SAS plus OAuth2; the authentication configuration travels in STAC, GDAL,
and point-cloud data-source URIs.
Build reusable layouts instead of per-output workarounds
- Layout legends can wrap text in millimeters and synchronize using explicit
layer-selection modes.
- Atlas polygons can reshape map frames for clipping and masking, and an atlas
can render only its current coverage feature.
- Charts accept expression-driven series, filtering, ordering, pie plots, and
renderer-derived categories and colors.
- Geospatial PDF export can preserve the project layer tree when the map has no
locked layers, but does not support mutually exclusive groups.
Treat elevation profiles as project resources
Profiles can be saved, reopened, renamed, removed, and optionally synchronized
to the main layer tree. Per-layer custom tolerance overrides the widget-wide
value. Point clouds can render continuous profile lines, and a profile curve
can be displayed in 3D with linked cursor feedback.
Validate point-cloud dependency gates
- M3C2 comparison requires a build with PDAL later than 2.10.
- PDAL TIN maximum-edge filtering requires PDAL 2.6+ and wrench 1.2.2+.
- VPC editing requires the VPC and every linked COPC file to be local.
- A
.vpz may contain a zipped VPC, and multiple assets with the overview
role can supply zoomed-out overviews.
Select Processing outputs precisely
Temporary outputs can retain user-selected layer names. Batch Processing also
accepts temporary outputs. For raster output, set creation options and NoData
values where exposed; for vector packaging, remember that an extent filter
still creates an empty packaged layer when nothing intersects.
Control QGIS Server recovery and caching
Set QGIS_SERVER_PROJECT_CACHE_SIZE to configure the server project cache.
Set QGIS_SERVER_RETRY_BAD_LAYERS=true when each request should retest layers
previously accepted as invalid and restore them after dependencies recover.
Common correctness checks
Labels and symbols
- Budget symbol extent buffers: larger buffers fix off-canvas generated-symbol
clipping but increase rendering work.
- HTML label backgrounds do not work on curved text; negative margins are
limited to the bottom margin.
- Cross-layer duplicate suppression compares text case-sensitively.
- Whitespace-ignoring collisions apply only to curved placement and default
off.
- Multipart split labeling drops surplus lines when parts are insufficient;
vertex-based curved placement similarly drops excess characters.
Rasters and geometry
- Raster rank excludes NoData by default; its alternate mode propagates any
input NoData.
- Extract Min/Max Pixel returns one point when multiple pixels tie.
- Approximate Medial Axis uses a 2D projection and ignores Z.
native:forcecw and native:forceccw use opposite exterior/interior ring
conventions; select the intended convention explicitly.
- Enabling Z transformation in Reproject Layer changes vertical coordinates as
well as horizontal ones.
Layouts and projects
- Project scale method affects displayed/API scale, visibility, Processing,
layouts, and server renders, but not map-unit symbol sizes.
- Geospatial PDF layer-tree preservation exports visible and invisible project
layers and enables attributes for either all layers or none.
- Project-embedded Python is governed separately for macros, expressions,
actions, and form initialization; do not assume a single trust switch.
3D and point clouds
- STL export does not preserve textures; use OBJ when textures matter.
- Environmental cube-map lighting applies to physically based materials but
not fixed-gradient backgrounds.
- Some instanced 3D Tiles encodings are unsupported: quantized positions,
oct-encoded rotations, and feature IDs.
- Remote VPC display does not imply remote editing support.
Version and dependency discipline
Treat provider-advertised capabilities and compiled dependency versions as
runtime facts. In particular, check GDAL before COG, GeoPackage-domain, and
dataset-identification work; PDAL and wrench before point-cloud algorithms;
SFCGAL before medial-axis extensions; and GeoPandas before dataframe export.
When preserving an older project's behavior, set formerly implicit options
explicitly and verify results visually as well as through API or algorithm
outputs.
1---2name: qgis-knowledge-patch3description: QGIS4license: MIT5---678# QGIS Knowledge Patch910Use this skill when changing QGIS projects, plugins, Processing workflows,11providers, QGIS Server deployments, cartography, layouts, elevation profiles,12or 3D and point-cloud workflows. Inspect the project's QGIS, Qt, GDAL, GEOS,13PDAL, SFCGAL, and provider versions before applying version-dependent advice.1415## How to use this skill16171. Identify whether the task concerns desktop behavior, server behavior,18 Processing, Python/C++ APIs, plugin metadata, or provider capabilities.192. Read the matching topic reference below. Consult more than one when a20 workflow crosses boundaries, such as a plugin invoking Processing or a21 server project backed by PostgreSQL.223. Check dependency gates explicitly. Several features require particular23 GDAL, PDAL, wrench, SFCGAL, or GeoPandas versions.244. Preserve changed defaults deliberately when upgrading existing projects.255. Test provider- and rendering-dependent work against the actual data source,26 because advertised service capabilities and build options affect behavior.2728## Reference index2930| Reference | Topics |31| --- | --- |32| [Cartography, labeling, layouts, and profiles](references/cartography-labeling-layouts-and-profiles.md) | Symbols, labels, temporal display, print layouts, charts, forms, and elevation profiles |33| [Data sources, databases, and server](references/data-sources-databases-and-server.md) | STAC, WMS/WFS/OAPIF, authentication, PostgreSQL, GeoPackage, SQL Server, and QGIS Server |34| [Plugins, APIs, and user interface](references/plugins-api-and-user-interface.md) | Plugin migration, PyQGIS/C++ APIs, expressions, themes, GPS, trust, menus, and settings |35| [Processing, geometry, and raster](references/processing-geometry-and-raster.md) | Algorithms, digitizing, geometry engines, raster export, reprojection, and packaging |36| [3D, mesh, and point cloud](references/three-d-mesh-and-point-cloud.md) | 3D scenes, materials, mesh, COPC/VPC, point-cloud editing, and profiles |3738## Breaking changes and migration traps3940### Declare QGIS 4 plugin compatibility with version bounds4142Plugin compatibility is determined by `qgisMinimumVersion` and the optional43`qgisMaximumVersion`. If the maximum is absent, compatibility extends only to44the end of the minimum version's major line. A plugin retaining QGIS 3.2245support while declaring QGIS 4 compatibility can use:4647```ini48[general]49qgisMinimumVersion=3.2250qgisMaximumVersion=4.9951```5253The QGIS 4 Ready list accepts a plugin when either bound is at least 4.0.54Remove `supportsQt6=True`: QGIS no longer recognizes it. Before widening the55range, replace Qt 5-only APIs and direct `PyQt5` imports with Qt 6 equivalents,56prefer `qgis.PyQt`, test under QGIS 4, and run `pyqgis4-checker`. Its Qt6 Check57findings identify files and lines but do not block upload or approval.5859### Target the separate QGIS 4 settings location6061QGIS 4 settings are isolated from QGIS 3. First startup performs a one-time,62lossless copy of the loaded QGIS 3 profile, but later changes do not63synchronize. Update installation, profile-management, and enterprise scripts64to target the QGIS 4 location.6566### Account for changed server and layout defaults6768- The QGIS Server OAPIF root is `/ogcapi`, not `/wfs3`. Override it with69 `QGIS_SERVER_API_WFS3_ROOT_PATH` when a deployment needs another path.70- New layout legends default to Visible Layers. Choose All Project Layers or71 Manual Layer Selection when that is the intended contract; a global layout72 setting can restore the earlier default.73- WMS service resolution for scale-aware raster extraction defaults to 96 DPI.74- Merge Vector Layers still enables source `layer` and `path` fields by75 default for backward compatibility.7677### Replace deprecated hub-distance algorithms7879Use the C++ Hub Distance algorithm. It replaces Distance to Nearest Hub80(Points) and Distance to Nearest Hub (Line to Hub), exposes both optional81outputs, and leaves the older pair deprecated.8283## High-value workflow guidance8485### Make Cloud Optimized GeoTIFF intent explicit8687When GDAL 3.13 or later is present, raster Save and Export dialogs can request88COG optimization and pyramids, and Processing can bulk-convert a directory.89For Processing outputs pass `-of COG`; the `.tif` or `.tiff` extension cannot90distinguish the COG and GTiff drivers.9192### Handle temporal raster and WMS behavior deliberately9394Raster layers representing temporal values can accumulate pixels across time.95WMS-T groups can derive a recursive time dimension from children, and a fixed96raster date/time can define both temporal endpoints. Disabling time propagation97on a group prevents child dimensions from reaching its parent.9899### Use the expanded geometry APIs and engines100101- PyQGIS exposes `QgsGeos` directly.102- `QgsGeometry.as_numpy()` preserves XY, XYZ, XYM, or XYZM dimensionality.103- `QgsGeometry.area3D()` returns surface area for polygonal and surface types,104 and zero for points and lines.105- `QgsVectorLayer.as_geopandas()` creates a GeoPandas dataframe when GeoPandas106 is installed.107- SFCGAL is available through `QgsSfcgalEngine` and `QgsSfcgalGeometry`.108109### Choose OAPIF formats and paths intentionally110111OGC API Features connections can select advertised formats, including GML and112bulk-download choices, rather than always using GeoJSON. The server exports113FlatGeobuf. Keep client format selection and the `/ogcapi` server root aligned114with deployment routing.115116### Use durable OAuth2 and cloud authentication117118OAuth2 can attach extra token-endpoint values as HTTP headers and refresh119tokens automatically while connections remain in use. Authentication-manager120SAS signing supports Microsoft Planetary Computer, while Pro GeoCatalogs can121use SAS plus OAuth2; the authentication configuration travels in STAC, GDAL,122and point-cloud data-source URIs.123124### Build reusable layouts instead of per-output workarounds125126- Layout legends can wrap text in millimeters and synchronize using explicit127 layer-selection modes.128- Atlas polygons can reshape map frames for clipping and masking, and an atlas129 can render only its current coverage feature.130- Charts accept expression-driven series, filtering, ordering, pie plots, and131 renderer-derived categories and colors.132- Geospatial PDF export can preserve the project layer tree when the map has no133 locked layers, but does not support mutually exclusive groups.134135### Treat elevation profiles as project resources136137Profiles can be saved, reopened, renamed, removed, and optionally synchronized138to the main layer tree. Per-layer custom tolerance overrides the widget-wide139value. Point clouds can render continuous profile lines, and a profile curve140can be displayed in 3D with linked cursor feedback.141142### Validate point-cloud dependency gates143144- M3C2 comparison requires a build with PDAL later than 2.10.145- PDAL TIN maximum-edge filtering requires PDAL 2.6+ and wrench 1.2.2+.146- VPC editing requires the VPC and every linked COPC file to be local.147- A `.vpz` may contain a zipped VPC, and multiple assets with the `overview`148 role can supply zoomed-out overviews.149150### Select Processing outputs precisely151152Temporary outputs can retain user-selected layer names. Batch Processing also153accepts temporary outputs. For raster output, set creation options and NoData154values where exposed; for vector packaging, remember that an extent filter155still creates an empty packaged layer when nothing intersects.156157### Control QGIS Server recovery and caching158159Set `QGIS_SERVER_PROJECT_CACHE_SIZE` to configure the server project cache.160Set `QGIS_SERVER_RETRY_BAD_LAYERS=true` when each request should retest layers161previously accepted as invalid and restore them after dependencies recover.162163## Common correctness checks164165### Labels and symbols166167- Budget symbol extent buffers: larger buffers fix off-canvas generated-symbol168 clipping but increase rendering work.169- HTML label backgrounds do not work on curved text; negative margins are170 limited to the bottom margin.171- Cross-layer duplicate suppression compares text case-sensitively.172- Whitespace-ignoring collisions apply only to curved placement and default173 off.174- Multipart split labeling drops surplus lines when parts are insufficient;175 vertex-based curved placement similarly drops excess characters.176177### Rasters and geometry178179- Raster rank excludes NoData by default; its alternate mode propagates any180 input NoData.181- Extract Min/Max Pixel returns one point when multiple pixels tie.182- Approximate Medial Axis uses a 2D projection and ignores Z.183- `native:forcecw` and `native:forceccw` use opposite exterior/interior ring184 conventions; select the intended convention explicitly.185- Enabling Z transformation in Reproject Layer changes vertical coordinates as186 well as horizontal ones.187188### Layouts and projects189190- Project scale method affects displayed/API scale, visibility, Processing,191 layouts, and server renders, but not map-unit symbol sizes.192- Geospatial PDF layer-tree preservation exports visible and invisible project193 layers and enables attributes for either all layers or none.194- Project-embedded Python is governed separately for macros, expressions,195 actions, and form initialization; do not assume a single trust switch.196197### 3D and point clouds198199- STL export does not preserve textures; use OBJ when textures matter.200- Environmental cube-map lighting applies to physically based materials but201 not fixed-gradient backgrounds.202- Some instanced 3D Tiles encodings are unsupported: quantized positions,203 oct-encoded rotations, and feature IDs.204- Remote VPC display does not imply remote editing support.205206## Version and dependency discipline207208Treat provider-advertised capabilities and compiled dependency versions as209runtime facts. In particular, check GDAL before COG, GeoPackage-domain, and210dataset-identification work; PDAL and wrench before point-cloud algorithms;211SFCGAL before medial-axis extensions; and GeoPandas before dataframe export.212When preserving an older project's behavior, set formerly implicit options213explicitly and verify results visually as well as through API or algorithm214outputs.