QGIS Knowledge Patch
Use this skill when implementing, reviewing, migrating, or troubleshooting QGIS
desktop, Server, Processing, provider, or PyQGIS work where recent behavior can
change the answer.
How to use this patch
- Identify the QGIS version and, for provider-backed features, the packaged
GDAL, PDAL, wrench, GEOS, or SFCGAL versions.
- Read only the topic references needed for the task.
- Apply guidance introduced no later than the project's QGIS version.
- Prefer the installed build's capabilities, project files, and runtime
behavior when they differ from this guidance.
- Treat UI defaults separately from API availability and provider-library
prerequisites.
Reference index
| Reference |
Use for |
| 3D, mesh, and point clouds |
3D scenes, mesh editing, VPC/COPC, point-cloud rendering, editing, and analysis |
| Data sources and databases |
STAC, PostgreSQL, SQL Server, imports, Browser administration, OAPIF clients, and SensorThings |
| Expressions and APIs |
Expressions, PyQGIS geometry, GPS, SFCGAL, GeoPandas, and 3D extension APIs |
| Layouts, editing, and profiles |
Layouts, legends, charts, digitizing, forms, attributes, and elevation profiles |
| Plugins, projects, and migration |
QGIS 4 plugin metadata, Qt 6 migration, themes, project trust, profiles, and custom UI |
| Processing and analysis |
Native, raster, vector, terrain, network, geometry, and metadata algorithms |
| Rendering and labeling |
Labels, symbols, masks, temporal rasters, annotations, and style transfer |
| Server and web services |
QGIS Server, WMS/WFS/OAPIF, OAuth2, caching, GetFeatureInfo, and remote raster behavior |
Breaking changes and migration
Advertise QGIS 4 compatibility with version bounds
For plugin repositories, use qgisMinimumVersion and optional
qgisMaximumVersion. With no maximum, compatibility is assumed only through
the end of the minimum version's major line. A plugin retaining QGIS 3.22
support while advertising QGIS 4 support 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; it is no longer recognized. Before widening the
range, replace Qt 5-only APIs and direct PyQt5 imports, preferably using
qgis.PyQt, test on QGIS 4, and use the repository's pyqgis4-checker report.
See Plugins, projects, and migration.
Redirect settings and deployment automation
QGIS 4.2 uses settings separate from QGIS 3. Its first startup makes a
one-time, lossless copy of the loaded QGIS 3 profile, but later edits do not
synchronize. Installation, profile, backup, and enterprise deployment scripts
must target the QGIS 4 location.
Update the QGIS Server OAPIF route
Since 4.0, the default OAPIF root is /ogcapi, replacing /wfs3. Set
QGIS_SERVER_API_WFS3_ROOT_PATH when a deployment needs another path, and
update reverse-proxy routes, clients, and tests together.
Replace deprecated hub-distance algorithms
Since 4.0, the C++ Hub Distance algorithm replaces Distance to Nearest Hub
(Points) and Distance to Nearest Hub (Line to Hub). It provides both optional
outputs; migrate models and automation away from the two deprecated IDs.
Account for changed legend defaults
Since 4.0, layout legends use All Project Layers, Visible Layers, or Manual
Layer Selection instead of the former Auto update checkbox. New legends
default to Visible Layers. This follows layer-tree visibility and changes but
does not filter by map extent; a global layout option restores the old default.
Capability gates
Check runtime library versions before exposing these operations:
- COG export controls and GDAL Data Identification require GDAL 3.13 or later
(4.0).
- GeoPackage field-domain updates and deletion require GDAL 3.12 or later
(4.0).
- M3C2 point-cloud comparison requires a build with PDAL later than 2.10
(4.0).
- Export to Raster (TIN) maximum-edge filtering requires PDAL 2.6+ and wrench
1.2.2+ (4.0).
- Approximate Medial Axis
extendToEdges requires SFCGAL 2.3 (4.2).
- Some raster, point-cloud, 3D Tiles, I3S, and provider features remain
conditional on the providers compiled into the installed QGIS build.
High-value desktop behavior
Choose the right layout-legend mode
- All Project Layers tracks the whole project.
- Visible Layers tracks visibility, order, and layer-tree changes.
- Manual Layer Selection keeps an explicit list.
- Per-layer automatic legend inclusion is enabled by default for vector,
raster, mesh, and point-cloud layers (4.0).
Keep temporary outputs named
Processing outputs can remain temporary while using a user-selected layer
name (4.0). The memory-chip icon still identifies them as temporary; naming a
result does not persist it.
Preserve raw provider values when copying
Attribute tables and Identify Results can copy literal provider values rather
than represented values affected by locale formatting, expressions, or display
relations (4.0). Choose the raw action for round-tripping or exact comparisons.
Use cumulative temporal raster rendering
Raster layers in represent-temporal-values mode can accumulate pixels over
time (4.0), matching cumulative vector animation behavior. Enable it when
raster and vector frames must remain temporally aligned.
Use isolated label-collision controls
- Cross-layer margins reserve space around a label (3.44).
- Duplicate prevention suppresses case-sensitive matching text within a
minimum distance across all layers (3.44).
- Curved labels can ignore spaces and tabs during collision tests; this is off
by default and applies only to curved placement (4.0).
High-value Processing behavior
Distinguish COG from ordinary GeoTIFF
When creating Cloud Optimized GeoTIFF output, pass -of COG explicitly (4.0).
The .tif or .tiff extension cannot distinguish the COG and GTiff drivers.
With GDAL 3.13+, export dialogs can also request optimization and pyramids.
Preserve provenance when merging vectors
Merge Vector Layers can add source layer and path attributes (3.42). The
option is enabled by default for backward compatibility; disable it only when
the output schema must exclude provenance.
Understand raster-rank NoData behavior
Raster rank uses positive ranks from the low end and negative ranks from the
high end: for [10, 20, 30, 40], 2 gives 20 and -2 gives 30 (3.44).
The default ignores NoData unless the requested rank is unavailable; the
alternate mode propagates NoData when any input cell is NoData.
Keep WMS extraction scale-aware
Clip Raster by Extent and Clip Raster by Mask Layer can request WMS input at a
reference scale and service resolution (4.0). The default service resolution
is 96 DPI. Use this when scale-dependent remote rendering must survive a clip.
High-value APIs
Geometry and dataframe conversion
QgsGeometry.as_numpy() preserves Z and M dimensionality as XYZ, XYM, or
XYZM arrays (3.42).
QgsGeos is directly available to PyQGIS for GEOS-specific operations not
exposed by QgsGeometryEngine (3.42).
QgsGeometry.area3D() computes polygonal surface area and returns zero for
points and lines (4.0).
QgsVectorLayer.as_geopandas() creates a GeoPandas dataframe when GeoPandas
is installed (4.0).
Time-zone semantics
convert_timezone preserves the instant and changes its local representation;
set_timezone replaces the zone without changing the date or time components
(4.0). Use timezone_from_id, timezone_id, and get_timezone for IANA-zone
creation and inspection.
Point-cloud color expressions
Point-cloud renderers can modify @point_color with point attributes (4.2).
Arithmetic is channel-by-channel RGBA. Multiplication permits the color on
either side, while other operators require it on the left, for example:
@point_color * (@intensity / 65535)
Server operational checks
QGIS_SERVER_PROJECT_CACHE_SIZE controls server project-cache QCache cost
(3.44).
QGIS_SERVER_RETRY_BAD_LAYERS=true retests previously bad layers on every
request and restores them after dependencies recover (4.0).
- HTML GetFeatureInfo can use only the layer maptip via the project setting
corresponding to
WITH_MAPTIP=HTML_FI_ONLY_MAPTIP (4.0).
- WMS highlight-label frames accept background, outline color, outline width,
and size vendor parameters, optionally scoped per map (4.2).
- QGIS Server can answer mesh GetFeatureInfo (4.0) and export FlatGeobuf from
OGC API Features (4.2).
Verification checklist
- Confirm the installed QGIS and provider-library versions.
- Check defaults separately for newly created and existing projects.
- For plugin migration, test imports, metadata bounds, UI behavior, and package
validation on QGIS 4.
- For Server changes, test direct requests and proxy-routed public URLs.
- For Processing, inspect output schema, NoData handling, CRS, temporary versus
persisted status, and conditional outputs.
- For 3D or point clouds, verify both renderer support and data locality before
enabling editing.
1---2name: qgis-knowledge-patch-23description: QGIS4license: MIT5---678# QGIS Knowledge Patch910Use this skill when implementing, reviewing, migrating, or troubleshooting QGIS11desktop, Server, Processing, provider, or PyQGIS work where recent behavior can12change the answer.1314## How to use this patch15161. Identify the QGIS version and, for provider-backed features, the packaged17 GDAL, PDAL, wrench, GEOS, or SFCGAL versions.182. Read only the topic references needed for the task.193. Apply guidance introduced no later than the project's QGIS version.204. Prefer the installed build's capabilities, project files, and runtime21 behavior when they differ from this guidance.225. Treat UI defaults separately from API availability and provider-library23 prerequisites.2425## Reference index2627| Reference | Use for |28| --- | --- |29| [3D, mesh, and point clouds](references/3d-mesh-and-point-clouds.md) | 3D scenes, mesh editing, VPC/COPC, point-cloud rendering, editing, and analysis |30| [Data sources and databases](references/data-sources-and-databases.md) | STAC, PostgreSQL, SQL Server, imports, Browser administration, OAPIF clients, and SensorThings |31| [Expressions and APIs](references/expressions-and-apis.md) | Expressions, PyQGIS geometry, GPS, SFCGAL, GeoPandas, and 3D extension APIs |32| [Layouts, editing, and profiles](references/layouts-editing-and-profiles.md) | Layouts, legends, charts, digitizing, forms, attributes, and elevation profiles |33| [Plugins, projects, and migration](references/plugins-projects-and-migration.md) | QGIS 4 plugin metadata, Qt 6 migration, themes, project trust, profiles, and custom UI |34| [Processing and analysis](references/processing-and-analysis.md) | Native, raster, vector, terrain, network, geometry, and metadata algorithms |35| [Rendering and labeling](references/rendering-and-labeling.md) | Labels, symbols, masks, temporal rasters, annotations, and style transfer |36| [Server and web services](references/server-and-web-services.md) | QGIS Server, WMS/WFS/OAPIF, OAuth2, caching, GetFeatureInfo, and remote raster behavior |3738## Breaking changes and migration3940### Advertise QGIS 4 compatibility with version bounds4142For plugin repositories, use `qgisMinimumVersion` and optional43`qgisMaximumVersion`. With no maximum, compatibility is assumed only through44the end of the minimum version's major line. A plugin retaining QGIS 3.2245support while advertising QGIS 4 support 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`; it is no longer recognized. Before widening the55range, replace Qt 5-only APIs and direct `PyQt5` imports, preferably using56`qgis.PyQt`, test on QGIS 4, and use the repository's `pyqgis4-checker` report.57See [Plugins, projects, and migration](references/plugins-projects-and-migration.md).5859### Redirect settings and deployment automation6061QGIS 4.2 uses settings separate from QGIS 3. Its first startup makes a62one-time, lossless copy of the loaded QGIS 3 profile, but later edits do not63synchronize. Installation, profile, backup, and enterprise deployment scripts64must target the QGIS 4 location.6566### Update the QGIS Server OAPIF route6768Since 4.0, the default OAPIF root is `/ogcapi`, replacing `/wfs3`. Set69`QGIS_SERVER_API_WFS3_ROOT_PATH` when a deployment needs another path, and70update reverse-proxy routes, clients, and tests together.7172### Replace deprecated hub-distance algorithms7374Since 4.0, the C++ Hub Distance algorithm replaces Distance to Nearest Hub75(Points) and Distance to Nearest Hub (Line to Hub). It provides both optional76outputs; migrate models and automation away from the two deprecated IDs.7778### Account for changed legend defaults7980Since 4.0, layout legends use All Project Layers, Visible Layers, or Manual81Layer Selection instead of the former Auto update checkbox. New legends82default to Visible Layers. This follows layer-tree visibility and changes but83does not filter by map extent; a global layout option restores the old default.8485## Capability gates8687Check runtime library versions before exposing these operations:8889- COG export controls and GDAL Data Identification require GDAL 3.13 or later90 (4.0).91- GeoPackage field-domain updates and deletion require GDAL 3.12 or later92 (4.0).93- M3C2 point-cloud comparison requires a build with PDAL later than 2.1094 (4.0).95- Export to Raster (TIN) maximum-edge filtering requires PDAL 2.6+ and wrench96 1.2.2+ (4.0).97- Approximate Medial Axis `extendToEdges` requires SFCGAL 2.3 (4.2).98- Some raster, point-cloud, 3D Tiles, I3S, and provider features remain99 conditional on the providers compiled into the installed QGIS build.100101## High-value desktop behavior102103### Choose the right layout-legend mode104105- All Project Layers tracks the whole project.106- Visible Layers tracks visibility, order, and layer-tree changes.107- Manual Layer Selection keeps an explicit list.108- Per-layer automatic legend inclusion is enabled by default for vector,109 raster, mesh, and point-cloud layers (4.0).110111### Keep temporary outputs named112113Processing outputs can remain temporary while using a user-selected layer114name (4.0). The memory-chip icon still identifies them as temporary; naming a115result does not persist it.116117### Preserve raw provider values when copying118119Attribute tables and Identify Results can copy literal provider values rather120than represented values affected by locale formatting, expressions, or display121relations (4.0). Choose the raw action for round-tripping or exact comparisons.122123### Use cumulative temporal raster rendering124125Raster layers in represent-temporal-values mode can accumulate pixels over126time (4.0), matching cumulative vector animation behavior. Enable it when127raster and vector frames must remain temporally aligned.128129### Use isolated label-collision controls130131- Cross-layer margins reserve space around a label (3.44).132- Duplicate prevention suppresses case-sensitive matching text within a133 minimum distance across all layers (3.44).134- Curved labels can ignore spaces and tabs during collision tests; this is off135 by default and applies only to curved placement (4.0).136137## High-value Processing behavior138139### Distinguish COG from ordinary GeoTIFF140141When creating Cloud Optimized GeoTIFF output, pass `-of COG` explicitly (4.0).142The `.tif` or `.tiff` extension cannot distinguish the COG and GTiff drivers.143With GDAL 3.13+, export dialogs can also request optimization and pyramids.144145### Preserve provenance when merging vectors146147Merge Vector Layers can add source `layer` and `path` attributes (3.42). The148option is enabled by default for backward compatibility; disable it only when149the output schema must exclude provenance.150151### Understand raster-rank NoData behavior152153Raster rank uses positive ranks from the low end and negative ranks from the154high end: for `[10, 20, 30, 40]`, `2` gives `20` and `-2` gives `30` (3.44).155The default ignores NoData unless the requested rank is unavailable; the156alternate mode propagates NoData when any input cell is NoData.157158### Keep WMS extraction scale-aware159160Clip Raster by Extent and Clip Raster by Mask Layer can request WMS input at a161reference scale and service resolution (4.0). The default service resolution162is 96 DPI. Use this when scale-dependent remote rendering must survive a clip.163164## High-value APIs165166### Geometry and dataframe conversion167168- `QgsGeometry.as_numpy()` preserves Z and M dimensionality as XYZ, XYM, or169 XYZM arrays (3.42).170- `QgsGeos` is directly available to PyQGIS for GEOS-specific operations not171 exposed by `QgsGeometryEngine` (3.42).172- `QgsGeometry.area3D()` computes polygonal surface area and returns zero for173 points and lines (4.0).174- `QgsVectorLayer.as_geopandas()` creates a GeoPandas dataframe when GeoPandas175 is installed (4.0).176177### Time-zone semantics178179`convert_timezone` preserves the instant and changes its local representation;180`set_timezone` replaces the zone without changing the date or time components181(4.0). Use `timezone_from_id`, `timezone_id`, and `get_timezone` for IANA-zone182creation and inspection.183184### Point-cloud color expressions185186Point-cloud renderers can modify `@point_color` with point attributes (4.2).187Arithmetic is channel-by-channel RGBA. Multiplication permits the color on188either side, while other operators require it on the left, for example:189190```qgis191@point_color * (@intensity / 65535)192```193194## Server operational checks195196- `QGIS_SERVER_PROJECT_CACHE_SIZE` controls server project-cache QCache cost197 (3.44).198- `QGIS_SERVER_RETRY_BAD_LAYERS=true` retests previously bad layers on every199 request and restores them after dependencies recover (4.0).200- HTML GetFeatureInfo can use only the layer maptip via the project setting201 corresponding to `WITH_MAPTIP=HTML_FI_ONLY_MAPTIP` (4.0).202- WMS highlight-label frames accept background, outline color, outline width,203 and size vendor parameters, optionally scoped per map (4.2).204- QGIS Server can answer mesh GetFeatureInfo (4.0) and export FlatGeobuf from205 OGC API Features (4.2).206207## Verification checklist208209- Confirm the installed QGIS and provider-library versions.210- Check defaults separately for newly created and existing projects.211- For plugin migration, test imports, metadata bounds, UI behavior, and package212 validation on QGIS 4.213- For Server changes, test direct requests and proxy-routed public URLs.214- For Processing, inspect output schema, NoData handling, CRS, temporary versus215 persisted status, and conditional outputs.216- For 3D or point clouds, verify both renderer support and data locality before217 enabling editing.