Bug report #21605

"Select Extent" (ExtentSelectionPanel) dialog not working for a number of processing algorithms

Added by Andrea Giudiceandrea 10 months ago. Updated 10 months ago.

Status:Closed
Priority:Normal
Assignee:-
Category:Processing/GUI
Affected QGIS version:3.4.5 Regression?:Yes
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:duplicate
Crashes QGIS or corrupts data:No Copied to github as #:29421

Description

With QGIS LTR 3.4.5-1 on Windows 7 64 bit, the "Select Extent" (ExtentSelectionPane.py) dialog is not working in processing algorithms which have an extent as input.

For example, in the "Random points in extent" (qgis:randompointsinextent) algorithm dialog window, clicking on the "Input extent" parameter ellipsis button and then on the "Use Layer Extent..." menu item, the following error is displayed in the QGIS Message bar

Python error: An error has occurred while executing Python code: See message log (Python Error) for more details.

and the following warning is written in the Python Error message log

WARNING    Traceback (most recent call last):
              File "C:/PROGRA~1/QGIS3~1.4/apps/qgis-ltr/./python/plugins\processing\gui\ExtentSelectionPanel.py", line 167, in useLayerExtent
              dlg = LayerSelectionDialog(self)
              File "C:/PROGRA~1/QGIS3~1.4/apps/qgis-ltr/./python/plugins\processing\gui\ExtentSelectionPanel.py", line 72, in __init__
              QgsMapLayerProxyModel.HasGeometry | QgsMapLayerProxyModel.RasterLayer | QgsMapLayerProxyModel.MeshLayer)
             AttributeError: type object 'QgsMapLayerProxyModel' has no attribute 'MeshLayer'

so it's impossible to select a layer extent as input extent of the processing algorithm.

Other processing algorithms affected are:

"Regular points" qgis:regularpoints
"Create constant raster layer" qgis:createconstantrasterlayer
"Create grid" qgis:creategrid
"Raster calculator" qgis:rastercalculator
"Clip vector by extent" gdal:clipvectorbyextent
"Clip raster by extent" gdal:cliprasterbyextent
...

Probably the bug was introduced at 06ee1326 backporting PR 9038 to 3.4: 'QgsMapLayerProxyModel' has no attribute 'MeshLayer' in 3.4 API but only since 3.6 (https://qgis.org/api/classQgsMapLayerProxyModel.html).

History

#1 Updated by Nyall Dawson 10 months ago

  • Resolution set to duplicate
  • Status changed from Open to Closed

Already fixed in 3.4

#2 Updated by Andrea Giudiceandrea 10 months ago

Apologize me, I just realized that the bug was already fixed with PR https://github.com/qgis/QGIS/pull/9332 for 3.4.6. Thanks Nyall.

Also available in: Atom PDF