Skip to content

[processing] Introduce QgsProcessingRasterLayerDefinition and make Raster Extraction algorithms work with WMSs requested at a given scale (Request in QGIS) #10241

@qgis-bot

Description

@qgis-bot

Request for documentation

From pull request qgis/QGIS#62937
Author: @gacarrillor
QGIS version: 4.0

[processing] Introduce QgsProcessingRasterLayerDefinition and make Raster Extraction algorithms work with WMSs requested at a given scale

PR Description:

This PR makes Raster Extraction algorithms work with WMS rasters requested at a particular scale, so that scale-dependant rendering (symbology/labeling) is preserved in the output raster.

The improved algorithms are Clip raster by extent and Clip raster by mask layer, although other GDAL algorithms could easily benefit from this enhancement in the future, e.g., Translate (convert format) or Raster information.

To achieve it, a brand new spanner button is next to WMS layers (the other raster types have the spanner button disabled), which shows an Advanced options panel when clicked.

vokoscreenNG-2025-08-22_18-37-44.mp4
image

The Reference scale is the scale at which the WMS raster should be requested/rendered.
The Service resolution is the resolution (in DPI) used by the server to render the WMS raster. By default 96 dpi.


This PR also introduces a QgsWmsUtils class for some utility functions related to WMS layers (e.g., get WMS version from a WMS layer or test if a raster layer is a WMS).


A bunch of unit tests were added for QgsProcessingRasterLayerDefinition, QgsWmsUtils, GdalUtils and the aforementioned algorithms.


Funded by City of Frankfurt – Stadtplanungsamt.

Commits tagged with [need-docs] or [FEATURE]

Metadata

Metadata

Assignees

No one assigned

    Labels

    4.0QGIS 4.0 new featuresProcessing Alg(Features of) An algorithm. Use the Help button in the application to find the page.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions