Project: QGIS

Changelog for version: 3.40


The QGIS Project is thrilled to announce the release of QGIS 3.40, refining the platform's capabilities for geospatial professionals and enthusiasts alike and underscoring the commitment to empower its users with groundbreaking tools for spatial discovery.

This release incorporates major strides in color management functionality, as described in QEP283, with the introduction of CMYK color support and the definition of International Color Consortium (ICC) color profiles for use in widgets, expressions, and cartography-oriented workflows to ensure accurate color representation across different media types.

Additionally, QGIS now allows for the storing of custom PyQGIS Expressions and methods directly within project files, providing users with greater flexibility in their data-handling processes. This functionality will also provide new opportunities for improved automation capabilities and is sure to boost productivity and facilitate more seamless collaboration for teams.

This release also includes a wealth of other new features that include improvements to Labeling, 3D views, Networking, Attribute tables, and many others.

QGIS is a community effort, and we would like to extend a big thank you to the developers, documenters, testers, and the many folks out there who volunteer their time and effort (or fund people to do so) to make these releases possible. From the QGIS community, we hope you enjoy this release! If you wish to donate time, money, or otherwise contribute towards making QGIS more awesome, please wander along to QGIS.ORG and lend a hand!

QGIS is supported by donors and sustaining members. A current list of donors who have made financial contributions large or small to the project can be seen on our list of donors. If you would like to become an official project sustaining member, please visit our sustaining member page for more details. Sponsoring QGIS helps us to fund our regular developer meetings, maintain project infrastructure, and fund bug-fixing efforts. A complete list of current sponsors is provided below - our very big thank you to all of our sponsors!

QGIS is free software and you are under no obligation to pay anything to use it - in fact, we want to encourage people far and wide to use it regardless of their financial or social status - we believe that empowering people with spatial decision-making tools will result in a better society for all of humanity.


Map Tools


Feature: Respect layer/project vert datum in identify results

When a vector layer and the project have vertical datums present, and they differ, then include the transformed Z value for the identified features in the project's datum too.

This feature was developed by Nyall Dawson


Feature: Present referencing relations (in addition to referenced ones), and support them on arbitrary nesting level

Previously only referenced relations where presented when exploring a feature, now referenced ones are presented as well. Do that only when the user explicit unfolds a node, to avoid potential 'explosion' of the number of features in the tree in case of a huge database where all features would be connected through relations. If through relations a feature already present in an ancestor node is detected, it is omitted from the related features.

Add setting parameters to disable showing relations

Add a contextual menu item "Identify Feature" to be able to "re-center" the result of the identification tree on a nested feature, to limit the nesting depth.

==>

This feature was developed by Even Rouault


User Interface


Feature: Actions Dialogue Duplicate Button

Description

Addresses this issue: https://github.com/qgis/QGIS/issues/57399

Before screenshot:
image

After screenshot:
image

This adds a duplicate button to the layer properties actions dialogue. How it works: when a row is selected in the actions list, clicking the duplicate button will open a dialogue with all of the attributes of that row, allowing them to be edited. When clicking ok, it is submitted as a new row instead of editing the original.

Additionally, I edited the src/ui/qgsattributeactiondialogbase.ui file to put the components I was working with in order.

This feature was developed by Speedrace4


Symbology


Feature: Provide style categories for raster layers

On copy/paste

Until now one only could copy/paste all categories (AllStyleCategories) on raster layer, what meant the following categories where considered: - LayerConfiguration - Temporal - Elevation - MapTips - Notes (what means right click -> layer notes) - CustomProperties - Symbology - Rendering (including Histogram stuff)

New you can choose what categories you want to consider.

Additionally AttributeTable is available to store the path to FileBasedAttributeTables.

Note: Symbology and Render are are melted together in the pipe object, they cannot be split. Means when Symbology is chosen as well Render parts are exported/imported and when Render is chosen as well Symbology parts are exported/imported - maybe one could split, but it would lead to backwards incompatibility.

On save/load to file

Until now only those categories could be stored and loaded with QML/SLD file: - Symbology - Rendering - CustomProperties

by selecting Symbology category only.

Now here the categories mentioned above are provided as well.

Note Not implemented are: - Categories Symbology3D, Labeling, Fields, Forms, Actions, Diagrams, GeometryOptions since they do not make sense for rasters - Legend Category - because it has no effects yet. The Embedded Widgets are concerned by the CustomProperties and the Legend placeholder image is not yet handled at all (neither in the vector layers). - Section QGIS Server is not yet handled at all (neither in the vector layers). - Section Metadata is provided by QMD export separate

Additionally I removed the reading of customProperties in every case 613e83b2611191017f766b3304b8073ef5057016 since it was read double.

This feature was developed by signedav


Feature: Add "Linear Referencing" symbol layer type

This new symbol layer type allows placing text labels at regular intervals along a line (or at positions corresponding to existing vertices). Positions can be calculated using Cartesian distances, or interpolated from z/m values.

Functionality includes:

  • Labels can be placed using fixed cartesian 2d distances, at regular linearly interpolated spacing calculated using the Z or M values in geometries, or at existing vertices
  • Labels can show either the running total distance, or the linearly interpolated Z/M value
  • Uses text renderer to draw labels, so the full range of functionality is available for the labels (including buffers, shadows, etc)
  • Uses the QGIS numeric format classes to format numbers as strings, so users have full range of customisation options for eg decimal places
  • An optional "skip multiples of" setting. If set, then labels which are a multiple of this value will be skipped over. This allows construction of complex referencing labels, eg where a symbol has two linear referencing symbol layers, one set to label every 100m in a small font, skipping multiples of 1000, and a second set to label every 1000m in a big bold font
  • Labels are rendered using an angle calculated by averaging the linestring, so sharp tiny jaggies don't result in unslightly label rotation
  • Optionally, markers can be placed at referenced points in the line string, using a full QGIS marker symbol (this allows eg showing a cross-hatch at the labeled point, for a "ruler" style line)
  • Data defined control over the placement intervals, skip multiples setting, marker visibility and average angle calculation length

Notes:

  • When using the distance-based placement or labels, the distances are calculated using 2D only, Cartesian calculations based on the original layer CRS. This could potentially be extended in future to expose options for 3D Cartesian distances, or ellipsoidal distance calculations.

This feature was funded by the Swiss QGIS User Group

This feature was developed by Nyall Dawson


Feature: [CMYK] Implement color ramp interpolation

This feature was funded by Bordeaux Métropôle**

This feature was developed by Julien Cabieces


Feature: [CMYK] Add a specific preview for CMYK color

I propose to display CMYK color with 2 decimal digit in percent like in the color widget

while the RGB one stay unchanged except that I added the A to RGB (We could also put Alpha on its own line for both RGB and CMYK, I have no strong opinion on this)

This feature was funded by Métropôle de Bordeaux**

This feature was developed by Julien Cabieces


Feature: [ColorWidget] Select color component as float

Allows to select color component as float with 2 decimals.

This feature was funded by Bordeaux Métropôle**

This feature was developed by Julien Cabieces


Feature: Allow end point marker symbols for balloon callout style

Allows rendering a marker symbol below the endpoint of the balloon callout. Designed to allow balloon callouts to reproduce the same visual appearance as the older annotation framework items.

This feature was developed by Nyall Dawson


Feature: Buffers for marker symbols

This PR implements "buffers" for marker symbols. Just like label buffers, marker buffers are a halo effect around marker symbols designed to make the symbol more readable against different backgrounds.

Buffers are defined on a symbol level (not per symbol-layer), and are calculated and drawn using the shape of ALL the symbol layers in the marker. This makes them super-easy to configure, as getting the same result by hand would require many duplicate symbol layers and duplicate settings across these!

This change is designed to plug on of the (very few!) remaining large symbology gaps between ArcMap and QGIS, where ArcMap has had support for solid color marker "halos" for decades.

https://github.com/user-attachments/assets/ce3f1bb2-19ac-47c5-be41-7832627d3960

This feature was funded by North Road, thanks to SLYR

This feature was developed by Nyall Dawson


Feature: Support tolerances for QgsRasterTransparency pixel values

Allows pixels with color components just outside of the specified RGB values to also be treated as transparent pixels

Useful for photographs or compressed rasters where a range of color values must be made transparent.

https://github.com/user-attachments/assets/995373d2-78d5-423c-83ea-cc2569898001

This feature was funded by Middle Third Geological

This feature was developed by Nyall Dawson


Annotations


Feature: Auto upgrade SVG and text annotations to annotation layer items on project load

When loading old projects, any of the old SVG and text annotations will automatically be converted to the newer picture and rectangular text annotation item types.

Remove the actions for creating new SVG and text annotations, and require users to use the corresponding annotation items instead.

Refs https://github.com/qgis/QGIS-Enhancement-Proposals/issues/269

This feature was developed by Nyall Dawson


Feature: Add support for callouts to point text, rect text and picture items

Allows creating of callout lines (or bubble callouts) which link the text to a map location. To create a callout, users select the text item and then drag out the central x node to the desired callout end point.

Callout styles can be modified through the layer styling panel.

https://github.com/user-attachments/assets/1a5006c6-69cb-4179-a844-4b4b4dc876c8

This feature was developed by Nyall Dawson


Feature: Add linked layer option for annotation layers

Adds a new "Linked layer" setting to the render page for annotation layers, which allows users to optionally set a linked visibility layer for the annotation layer. If set, then the annotations will only be drawn when the linked layer is visible in the map.

This is designed to mimic the similar linked layer option for the older annotation framework, in order to close the feature gap between old vs new annotations

Refs https://github.com/qgis/QGIS-Enhancement-Proposals/issues/269

This feature was developed by Nyall Dawson


Feature: Text inside rectangle annotation item

Builds off https://github.com/qgis/QGIS/pull/58126 and adds a "text inside rectangle" annotation item type

Refs https://github.com/qgis/QGIS-Enhancement-Proposals/issues/269

This feature was developed by Nyall Dawson


Feature: Add picture annotation item type

Can render SVG or raster images as items in an annotation layer. Options are present for:

  • Locking the picture's aspect ratio
  • Drawing with a background symbol
  • Drawing with a border symbol
  • Linked or embedded pictures
  • Rendering with scale dependent sizes or fixed sizes

This feature was developed by Nyall Dawson


Labelling


Feature: [feature] Support horizontal alignment in HTML labels

For multi-line labels, this allows use of either:

  • HTML

    attributes

  • CSS "text-align: xxx"
  • HTML
    some text
    tags

Supported alignments are left, right, center and justify

Horizontal alignment can be used in all contexts where HTML text is rendered, EXCEPT for curved labels (since they are restricted to single-line text)

This feature was funded by City of Freiburg im Breisgau

This feature was developed by Nyall Dawson


Feature: [feature] Support h1/h2/.../h6 formatting in html labels

This feature was funded by City of Freiburg im Breisgau

This feature was developed by Nyall Dawson


Feature: [feature] Add support for word-spacing CSS in html labels

...and other places HTML text formatting is accepted.

This allows use of CSS "word-spacing: 12" to increase the word spacing in a section of HTML text. The word spacing is always treated as being in point units.

This feature was funded by City of Freiburg im Breisgau

This feature was developed by Nyall Dawson


Feature: Implementation of labeling engine rules

See https://github.com/qgis/QGIS-Enhancement-Proposals/issues/299

Implements the API framework for setting advanced labeling engine rules for a project, and implements 4 initial rule types:

  • QgsLabelingEngineRuleMinimumDistanceLabelToFeature: prevents labels being placed too close to features from a different layer
  • QgsLabelingEngineRuleMaximumDistanceLabelToFeature: prevents labels being placed too far from features from a different layer
  • QgsLabelingEngineRuleMinimumDistanceLabelToLabel: prevents labels being placed too close to labels from a different layer
  • QgsLabelingEngineRuleAvoidLabelOverlapWithFeature: prevents labels being placed overlapping features from a different layer

(note that the first 3 rules require a build based on GEOS >= 3.10, they are not available for older GEOS builds)

Also implements a registry for storing available rule classes, and serialization of rules and configuration in QGIS projects

Now with GUI:

https://github.com/user-attachments/assets/a8854ce4-4a55-4c2f-abf9-8cc68517ceae

This feature was funded by Rubicon Concierge Real Estate

This feature was developed by Nyall Dawson


Diagrams


Feature: Introduce stacked diagrams

This PR extends the QGIS diagram module allowing it to create and display stacked diagrams, i.e., diagrams located side by side. We've also taken the opportunity to move the diagram settings from a modal dialog to the Styling dock widget.

Stacked diagrams can be configured and displayed horizontally or vertically. The spacing between the so called subdiagrams can also be configured.

Stacked diagrams allow users to create complex diagrams like population pyramids.

Stacked diagrams can show mixed subdiagram types (e.g., a pie chart alongside a histogram) and users can add as many subdiagrams as they want. Moreover, subdiagrams can use different renderer types: e.g., one subdiagram could use a single category renderer, whereas the other could use a linearly interpolated one.

Subdiagrams can set their own size and their own legend settings (e.g., one subdiagram could show its categories in the legend, whereas another one could hide its own categories).

Subdiagram ordering is given by item ordering in the Stacked Diagram page's list. In the future, users could re-arrange subdiagram ordering by dragging and dropping subdiagrams (left as follow-up).

Note there are some shared settings like placement settings (e.g., over point), that the stacked diagram will take from its first subdiagram. Thus, other subdiagrams won't be able to set or change those specific settings, unless they become the first subdiagram in the stacked diagram. Therefore, when editing a subdiagram that is not located in the first place, we show labels to let users know why they don't see the expected widgets (e.g., placement ones) and where they can find them (i.e., in the first subdiagram).

GUI Stacked Diagrams

https://github.com/user-attachments/assets/7b5a55af-45cd-4231-85b9-c6031b783a3f

GUI Single Diagram

Before / After (click to see it in large size)

Other samples (Note the corresponding point feature's geometry)

Mixed renderer type (pies using single category and histograms using linearly interpolated one):

Nested stacked diagrams (just because we can! Not exposed through GUI, but possible in core and showcased via unit test):



Includes tests.


Additional fixes:
+ Fix #58501
+ Fix #58782




Mesh


Feature: Add GUI for adding Quantized Mesh layers

Description

This pull request builds on #58222 and #58591 and creates a GUI for adding Quantized Mesh data sources and layers.

Since Quantized Mesh layers are loaded based on a JSON metadata file just like Cesium 3D layers, most of the GUI is reused.

This feature was funded by Swiss QGIS user group

This feature was developed by David Koňařík


Rendering


Feature: Support multiple URLs/sources for vector tiles

This is a draft/POC to allow a discussion.

Goal: rendering Mapbox Vector Tile layer having multiple sources

for instance: https://vectortiles.geo.admin.ch/styles/ch.swisstopo.basemap.vt/style.json (see online: https://cms.geo.admin.ch/fmc/bm.html) json { "version": 8, "id": "2fa0964e-8ce3-4fe9-91b3-2a0d18663c9d", "name": "basemap_v1.15.0", "sources": { "terrain_v1.0.0": { "url": "https://vectortiles.geo.admin.ch/tiles/ch.swisstopo.relief.vt/v1.0.0/tiles.json", "type": "vector" }, "base_v1.0.0": { "url": "https://vectortiles.geo.admin.ch/tiles/ch.swisstopo.base.vt/v1.0.0/tiles.json", "type": "vector" } }, "layers": [ …

This cannot be solved by using several QGIS layers since the symbols ordering doesn't necessarily match with the layers/sources.

The idea is to allow listing several URLs in the layer. The rendering of each tile will be done at once when every source are fetched.

I have adapted QgsVectorTileRawData so that it contains a list of QByteData instead of a single one. The MVT decoder has been adapted accordingly.

For the download algorithm I suppose we need to recombine the data into a single array.

The layer names are considered unique across sources. It might be necessary to map layer names to the proper source.

I have successfuly tested this for asynchronous tile fetching. Sync is implemented but not tested.

There is no UX yet to play with this, it will be done if the approach is accepted. But here is a project to play with: mapbox-multi-sources.qgs.zip

Screenshot with the log of the 2 sources fetched:

Looking forward to read your thoughts :)

This feature was developed by Denis Rouzaud


3D Features


Feature: Respect vector layer vertical crs settings in 3d map views

Requires that:

  1. A project has a non-geographic CRS set, and a vertical CRS set
  2. NEW 3d maps are created -- we don't currently expose any setting for users to modify the CRS for existing 3d maps

This feature was developed by Nyall Dawson


Feature: 3D Scene Clip Distance

A new option for setting gl_clipistance on 3D views will appropriately filter feature vertices that fall outside of the designated extent, effectively cropping the view on multiple planes.

This setting is controlled with the enableClipping() and disableClipping() methods on Qgs3DMapScene objects.

This feature was developed by Jean Felder


Print Layouts


Feature: Add support merging cells in manual tables

Allows adjacent cells to be merged in layout manual table items.

From the table editor, select multiple cells in a rectangular shape and then from the Table menu, click "Merge Selected Cells". Merged cells can be un-merged via the "Split Selected Cells" menu action.

Fixes https://github.com/qgis/QGIS/issues/51694

This feature was funded by FLYGHT7

This feature was developed by Nyall Dawson


Feature: [CMYK] Generate a valid PDF/X-4 file

Related to https://github.com/qgis/QGIS-Enhancement-Proposals/issues/283

If a colorspace has been set, QGIS would generate a valid PDF/X-4 file (actually not completely valid because of the GDAL issue https://github.com/OSGeo/gdal/issues/10436).

This feature was funded by Bordeaux Métropôle**

This feature was developed by Julien Cabieces


Feature: Add option to set geospatial PDF group name for items

This new setting, located in the layout item "Rendering" section, allows users to set an optional "group name" for use in geospatial PDF exports. When set, a matching layer tree group will be created in the exported geospatial PDF and the item will only be visible when this group is checked.

This allows content to be selectively displayed as a group by viewers of the geospatial PDF. Eg, it can allow extra layout content such as descriptive labels or legends to only be shown when layers from the group are visible, making geospatial PDF export much more flexible.

This feature was funded by Rubicon Concierge Real Estate Services

This feature was developed by Nyall Dawson


Feature: Added Page Properties qAction to layout main menu

Description

Adds a menu option to open Page Properties in main Layout menu (see image).

This was available only on right mouse click above empty paper - considered hidden by many users.

Fixes #26237

Fixes #27843 (already closed but this really fixes it)

See #27698 (solves first problem in a list - second is discussable (feature request), and third problem still exists - see bottom of this description)

It's kind of a improvement for #29033

See #35580 (solves point 2, according to @gioman we can also close this one, but I agree that we should entirely remove "Printer Page Setup..." option since it does nothing, whatever you set up there gets ignored and overridden by settings set up in "Page Properties", but this should be done by someone more experienced to left no traces behind.:

If we remove this "Printer Page Setup..." we could also close other bug reports noted above.

This is my first contribution, greetings from Bratislava contributor meeting, special thanks to @uclaros for helping me.

This feature was developed by Vedran Stojnović


Feature: Add scale method option for layout scale bars

A new option for selecting a user-defined method of calculating the map scale in print layouts is provided. This exposes options for calculating scale:

  • along the bottom of the map frame
  • along the middle of the map frame
  • along the top of the map frame
  • as an average of all three measurements

By default, new scale bars will utilize the average method (instead of the previously used "along bottom" method), which will better handle scenarios where the scale at the top or bottom of the map cannot be calculated (e.g. when the top or bottom of the map falls outside valid areas for the map CRS).

This feature was developed by Nyall Dawson


Expressions


Feature: Add 'Custom Expression' numeric format

This numeric format allows users to craft a custom QGIS expression to format numbers. The expression can use the @value variable to retrieve the value to be formatted, and then use any standard QGIS expression function to format this as desired.

It can be used anywhere QgsNumericFormat is accepted, eg layout scalebars, elevation plots, layout tables, and color ramp legends

This feature was funded by the Swiss QGIS User Group

This feature was developed by Nyall Dawson


Feature: Add line_interpolate_point_by_m and line_locate_m expressions

Description

This PR adds two new functions to our expression engine to work with M values along line strings:

  • line_interpolate_point_by_m: returns a point geometry of a matching m value interpolated along a line containing an m dimension.
  • line_locate_m: returns a distance from the beginning of a line where a matching m value was found.

These two functions coming in extremely handy when working with temporal data, e.g. a linestring representing a GPS track where the M value represents the epoch value.

Using this function alongside of temporal controller makes for beautiful animations that were previously harder to unlock:

https://github.com/user-attachments/assets/8a062173-dbf4-4af4-9173-210cf957820c

This feature was developed by Mathieu Pellerin


Feature: Add color_rgbf/color_cmykf/color_hsvf/color_hslf

According to QEP #283 , I propose to add 2 new expression functions to load RGB and CMYK color

Contrary to color_cmyk/rgb, qcolor_cmyk/rgb allows to load a color from float component (and not int) into a QColor object (and not a string representation).

This allows to avoid color conversions so we can write PDF with native CMYK colors coming from expression.

This is a first PR, I'm planning to add other functions with the same goal.

So far, I didn't deprecate the old functions.

This feature was funded by Bordeaux Métropôle**

This feature was developed by Julien Cabieces


Feature: Allow users to save expression functions in QGIS project file

Current situation: In the expression builder dialog, Python functions can only be saved in the user profile directory. If a user wants to share expression functions with colleagues, he/she needs to share his/her expressions directory or individual .py files, which is inconvenient (without mentioning the installation of those shared files won't be trivial either).

This PR allows users to also store expression functions into the current QGIS project file, making it easier to share functions with other interested parties.

Some details about the implementation:

  • At most, one [Project Functions] item will be listed in the left-hand side list widget (Function Editor tab).
  • Users will be able to add and remove the aforementioned item.
  • If a [Project Functions] item already exists in the list, the corresponding option in the Add Function File dialog will be disabled.
  • Project gets dirty when expression functions are added to the project or when they are edited.
  • When opening the QGIS project, we check user preferences about loading project functions (Never|Ask|For this session only|Not during this session|Always) and load project functions if they're allowed.
  • Project functions are unloaded when a project is closed, and the user functions are reloaded to avoid any potential overwrite done by project functions activated by a regular user (i.e., a user that does not alter Project functions but that loads (enabling them) them when opening the project).

    Note: This behavior differs with respect to expression functions saved in the user profile (i.e., when a function file is removed, expression functions are not unloaded for the ongoing QGIS session). The rationale behind this is that user functions need more knowledge from the user (she/he needs to write them or at least deal with Python files to install them), whereas in the case of projects, any (non-python-expert) user could trigger an overwrite just by opening the project with functions and allowing them in the QGIS session.

Unit tests included.


This feature was funded by the [QGIS user group Switzerland](.)

This feature was developed by Germap


Feature: Add info about usable "expression dialect" to filter dialog

The query builder used for entering filter expressions on vector layers now shows the supported expression dialect. This uses the new data provider methods introduced in https://github.com/qgis/QGIS/pull/58781.

This feature was funded by WhereGroup GmbH.

This feature was developed by Hannes


Feature: [Expression] add project/ramp_color_object functions

Those functions contrary to project/ramp_color doesn't return a string representation so there is no RGB conversion involved. This way we can use CMYK colors.

@nyalldawson @nirvn I failed to come up with a better name, and I really do think that we need another set of functions behaving differently that the old ones. Returning an object only on CMYK color seems hazardous.

This feature was funded by Bordeaux Metropole**

This feature was developed by Julien Cabieces


Digitising


Feature: Add circles intersection digitizing tool

Description

This PR adds a brand new advanced digitizing tool allowing for users to pick/digitize a point at the intersection of two circles. In action:

https://github.com/qgis/QGIS/assets/1728657/fdef5525-9777-4bb7-92dd-ad24f14a2701

The implementation adds an abstract advanced digitizing tool class to allow for more such "COGO" tools to be added in the future (e.g. intersection between a circle and a line + bearing).

The new functionality is exposed to our python bindings, which also means people can write plugins and prototype additional functionalities in python.

(The PR temporarily includes the construction guides work, I'll rebase when that is merged)

This feature was developed by Mathieu Pellerin


Feature: [advanced digitizing] Implement visual construction guides

Description

This PR adds visual construction guides to the advanced digitizing dock widget which builds on top of our preexisting CAD construction mode.

UI wise, the functionality is exposed through a set of actions within a new drop-down menu attached to the construction activation toolbar button:

When recording construction guides, QGIS will render all construction steps taken as dashed lines. Those lines will remain visible as long as advanced digitizing is enabled. The guides are snap-able, allowing for construction steps to begin mid-way into a previous set of steps too.

In action:

https://github.com/qgis/QGIS/assets/1728657/db8bd954-f9c0-4ed2-a324-2805853c88d1

The construction guides are stored in a vector layer, which is exposed through the advanced digitizing dock widget, allowing for further customization of those guides via e.g. python plugins.

This feature was developed by Mathieu Pellerin


Data Management


Feature: Allow setting VSI credentials when loading OGR/GDAL layers

This PR exposes the VSI credential options for user control when adding OGR vector/GDAL raster layers from the Data Source Manager, eg:

The underlying provider changes were discussed in https://github.com/qgis/QGIS/pull/57801. When credential options are found in a layer's URI, we use GDAL's VSISetPathSpecificOption to set the credential option for that VSI driver and bucket.

This allows per-vsi driver & bucket credentials for layers, whereas other approaches (like environment variable setting) force a single set of credentials to be used for an entire QGIS session. (And are difficult for users to set)

I've also taken the opportunity to cleanup a bunch of code relating to how VSI protocols are exposed in GUI, and how GUIs for GDAL configuration options are dynamically created.

Requires GDAL 3.5+

This feature was developed by Nyall Dawson


Metadata and Metasearch


Feature: Add metadata setting to override widget wrapper used for a parameter

Description

While it is possible to add new widget wrappers for Processing parameters there is no way to override standard widget wrappers defined for each parameter type. This was possible using old API and added a lot of flexibility in different use cases.

This PR adds support for a new parameter metadata setting "widget_type" which allows to allows to override standard widget wrapper for a parameter.

param.setMetadata( {'widget_wrapper': { 'widget_type': 'my_widget' }} )

This feature was developed by Alexander Bruy


Forms and Widgets


Feature: Allow reordering fields in new vector layer dialogs

....including scratch, shp, gpkg and spatialite:

Fixes #38241

This feature was funded by QGIS User Group Denmark

This feature was developed by Nyall Dawson


Feature: Support img tags in HTML label text

Allows use of img tags in HTML label content. The following logic is applied:

  • Image path is set via the src="xxx" attribute. Local, HTTP, and base64 encoded paths are permitted
  • Any image format readable by QGIS can be used
  • Image sizes can be specified via the width="##" and height="##" attributes. If width or height is not specified it will automatically be calculated from the original image size
  • If width or height are specified, they are considered to be in POINTS
  • The css width/height settings are NOT respected (this is a Qt limitation)
  • Images are not supported for curved text labels
  • Images are placed inline only, floating images are not supported

This feature was funded by City of Freiburg im Breisgau

This feature was developed by Nyall Dawson


Processing


Feature: [geometry] add support for polyhedral surface and TIN

Description

This PR adds support for the POLYHEDRALSURFACE and TIN simple features by introducing QgsPolyhedralSurface and QgsTriangulatedSurface: - QgsPolyhedralSurface inherits from QgsSurface - QgsTriangulatedSurface inherits from QgsPolyhedralSurface as a special case which only contains triangles.

This approach is similar to the one used by GDAL: https://gdal.org/en/latest/development/rfc/rfc64_triangle_polyhedralsurface_tin.html

Everything should work as expected: create a new layer or edit an existing one, WKT/WKB conversion, etc..

Some previous workarounds are also removed. For example: - TIN is now the multipart of a triangle - there is no need to convert a polyhedral surface or a TIN to a multi polygon when importing PostGIS data

This feature was funded by CEA/DAM, CP4SC, Oslandia

This feature was developed by Jean Felder


Feature: Processing Algorithm: Open file or URL

A simple native algorithm to be able to open local files in the corresponding programs or URLs in the web browser.

Useful in combination with the Download File Algorithm to open the resulting file or displaying results after models triggering external systems.

This feature was developed by signedav


Feature: Add processing parameter types for Area and Volume

Adds dedicated parameter types for Area and Volume values.

Modeled closely off the existing Distance parameter type.

image

This feature was developed by Nyall Dawson


Feature: Enhance the GDAL "Vector information" alg and add a new GDAL "Vector information (JSON)" alg

Description

  • Enhancements of the "Vector information" (gdal:ogrinfo) GDAL processing algorithm:
    The checkbox parameter ALL_LAYERS "Enable listing of all layer information", False by default, is added in order for the layer name to not be added to the ogrinfo command-line so it will output the info of all the layers in the dataset (see also https://github.com/qgis/QGIS/pull/45955).
    The advanced parameter EXTRA "Additional command-line parameters" (optional) is added in order to provide additional command-line options to the ogrinfo command (to be consistent with the "Raster information" (gdal:gdalinfo) GDAL processing algorithm (see also https://github.com/qgis/QGIS/pull/30377).

image

  • New "Vector information (JSON)" (gdal:ogrinfojson) GDAL processing algorithm (only available with GDAL >= 3.7):
    This algorithm will use the -json option of ogrinfo in order to create a JSON file containing the layer or dataset information.
    It has the same parameters as "Vector information" (gdal:ogrinfo), except for the parameter SUMMARY_ONLY "Summary output only" (-so option), which is replaced by FEATURES "Enable listing of features" (-features option), False by default.
    The algorithm output is a JSON file.
    I think this new algorithm fixes https://github.com/qgis/QGIS/issues/57945.

image

This feature was developed by Andrea Giudiceandrea


Feature: Allow adding Processing tools to Favorites

Description

Allow to add/remove Processing algorithms to Favorites. Contrary to the "Recently used" list, Favorites list is populated manually by the user and remains static no matter which algorithms were executed.
processing-favorite

To add an algorithm to Favorites use context menu
processing-add-favorite

The context menu is used to remove algorithm from Favorites. This works with the item in Favorites group and with algorithm item itself.
processing-remove-favorite

Fixes #29220.

This feature was developed by Alexander Bruy


Feature: Add creation options support to some native raster Processing algorithms

Description

Add raster creation options support to native raster Processing algorithms where this makes sense. This allows to create output rasters with desired compression level and other options like world file generation etc.

This feature was developed by Alexander Bruy


Feature: Support drag and drop for multi-layer parameters

Allows dragging and dropping layers from either the QGIS browser or file explorer onto any multiple-layer parameter panel. Handy when you have to add many layers and it's simpler to make a selection outside of the processing dialog.

This feature was developed by Nyall Dawson


Application and Project Options


Feature: [network] Implement a smart cache size

Description

This PR improves QGIS' handling of its network disk cache by using a smart cache size logic that dynamically sizes based on the disk cache storage's available space. The logic is taken from Firefox (https://github.com/mozilla/gecko-dev/blob/e0a62f1391f7d58fab20418adc9310b23708a792/netwerk/cache2/CacheFileIOManager.cpp#L4307), and will results in most users getting a larger cache size.

The objective here is to insure that our default cache size insures we are as friendly as we can to servers hosting XYZ tiles, incl. but not limited to OpenStreetMap.

Users can disable the smart cache size logic in favor of a static cache size in the Options dialog. On that front, the spin box represents MBs instead of KiBs, because we're in 2024 :)

This feature was developed by Mathieu Pellerin


Feature: Add an option to autosize all columns by default when opening an attribute table

Description

This is a re-submission of this closed PR: #57643 with the branch re-based onto a recent master branch.

This PR adds an option via a checkbox in the Data Sources tab of the Options Dialog (opened via the Settings menu) to always resize columns to contents when opening an attribute table.

This extends https://github.com/qgis/QGIS/pull/41276 and addresses a more recent request posted as a comment to the original feature request.

This was also discussed in this question on GIS Stack Exchange.

Screenshot of Options Dialog showing added checkbox at top right:

Quick screencast showing added default autosize behaviour with checkbox option checked.

This feature was developed by Ben Wirf


Feature: Add vertical CRS selection widget to vector layer properties

Follows the same behavior as the project setting, i.e.:

If the layer has a 3d crs set, then the widget is disabled with an explanatory note:

If the layer has a 2d crs set, then the user can select the appropriate vertical crs:

There's also a explanatory note detailing where vertical CRS are respected, along with a warning:

This feature was developed by Nyall Dawson


Feature: [CMYK] Properties widget

Add project properties configuration widgets.

When loading and ICC profile, QGIS force color model to keep consistency between color model and color space.

ICC profile widget part is not visible if QGIS is not built with Qt 6.8.0 or greater (That maybe require to be clearly advertise it t

he changelog)

This feature was funded by Bordeaux Métrôpole**

This feature was developed by Julien Cabieces


Profile Plots


Feature: Change elevation profile name

Description

This PR is a simple proposal to answer #58455. It adds a "Change Progile Name" menu item in the Options sub-menu of the Elevation Profile widget in order to allow the user to change the profile windows name to anything more meaningfull to him/her. The change is made through a modal QInputDialog.

Fixes #58455

This feature was developed by Simon


Feature: Ensure vector layer elevation profiles respect layer/map vert datums

This feature was developed by Nyall Dawson


Browser


Feature: add UX to load MVT layers from style URL only

If a tile vector layer is created with a style URL but not source, the style is fetched and sources are extracted from it.

Here is a demo with a layer having two sources: https://vectortiles.geo.admin.ch/styles/ch.swisstopo.lightbasemap.vt/style.json

https://github.com/user-attachments/assets/948db86c-e79f-40cd-9060-6bc84a31fc2a

This feature was developed by Denis Rouzaud


Feature: Add duplicate functionality to Browser connection items

Description

Add "Duplicate connection" action to the context menu of Browser connection items. This allows quickly make a copy of a connection to the same source when only a few details are differ (for example, different PostGIS database on the same server)

This feature was funded by [NaturalGIS](.)

This feature was developed by Alexander Bruy


Feature: Allow to create an empty GeoPackage from the context menu of the top-level GeoPackage node (fix #25116)

Description

There an inconsistency in behavior of the "Create Database" context menu item for SpatiaLite and GeoPackage nodes in the Browser. In case of SpatiaLite this action creates an empty database and adds a new connection while the same action for GeoPackage creates a new GeoPackage file with a layer and adds a new connection.

This is not only confusing but also not very convinient in some use cases when user needs an empty GeoPackage. Of course, it is possible to create an empty GeoPackage from the context menu of the directory nodes, but this again is not very intuitive and many users are not aware about this option.

This PR renames existing "Create Database" action to "Create Database and Layer" action and adds a new context menu action "Create Database" which creates an empty GeoPackage.

Fixes #25116.

This feature was funded by [NaturalGIS](.)

This feature was developed by Alexander Bruy


Feature: Add connections to cloud storage providers to browser

This PR introduces support for storing and browsing cloud storage connections to the QGIS browser panel. GDAL supported vector and raster data sources can be loaded directly from the cloud provider (we rely on GDAL's VSI cloud handlers for this functionality). Supports all GDAL VSI cloud handlers, including S3, Azure, Google Drive, etc.

Connections can be created, modified, removed, and exported/imported to/from XML files.

https://github.com/qgis/QGIS/assets/1829991/8f181bda-697e-4c13-b8e0-ac16cf933011

https://github.com/qgis/QGIS/assets/1829991/ee39e34f-534b-4a1e-8d22-b96577a1739c

Fixes https://github.com/qgis/QGIS/issues/35450

This feature was developed by Nyall Dawson


Feature: STAC core part one

Description

This is the first part of the implementation of https://github.com/qgis/QGIS-Enhancement-Proposals/issues/300 It includes the building block classes for parsing and handling STAC elements and allows interacting with STAC catalogs using the QGIS browser.

The contents of both static catalogs and STAC API endpoints can be retrieved using the new STAC root entry on the browser.

STAC Items that contain assets that are cloud optimized (COG, COPC, EPT for now) can be drag and dropped to the map canvas and those assets will be added as layers.

STAC Item assets may be downloaded to a local folder using the Download Assets dialog.

All Catalogs, Collections and Items properties can be examined using the STAC Object Details dialog:

In subsequent PRs the Data Source Manager implementation will be added which will also allow searching for Items and Collections

Any feedback is warmly welcome!

This feature was developed by Stefanos Natsis


Data Providers


Feature: implement separate wfs title

implements #55317

This feature was developed by Jürgen Fischer


Programmability


Feature: Exceptions raised on QgsDistanceArea methods

A QgsCsException is now raised when errors occur within QgsDistanceArea methods to prevent misleading analysis results and properly handle error propagation throughout the application

This feature was developed by Nyall Dawson


Feature: Add Method to Convert QgsRasterLayer to NumPy Array

Description

This pull request, as part of qgis/QGIS-Enhancement-Proposals#227, introduces a new method to PyQGIS that enables conversion of QgsRasterLayer into a NumPy array. This addition allows users to efficiently handle and analyze raster data using NumPy. This enhancement improves integration with NumPy while keeping it an optional dependency.

This feature was developed by Till Frankenbach


Feature: Implement QgsGeometry.as_numpy and .as_shapely

Description

Adds methods to QgsGeometry to convert it to a (list of) numpy array(s) or shapely object(s). This is part of https://github.com/qgis/QGIS-Enhancement-Proposals/issues/227. This enhancement improves integration with NumPy and Shapely while keeping them an optional dependency.

This feature was developed by Till Frankenbach