Bug report #16358

Can't use custom function to select by expression

Added by Ian Turton about 7 years ago. Updated about 7 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:Expressions
Affected QGIS version:2.18.3 Regression?:No
Operating System:linux Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:24268

Description

I'm following this tutorial (http://www.qgistutorials.com/en/docs/custom_python_functions.html) on custom expressions and all goes well - my function shows up in the custom section and seems to work for the preview giving 21S for the first feature. When I extend the selection expression to GetUtmZone() = '21S' the output preview still says 1. But when I click on the select button no features are selected.

This works on 2.14.x but fails on 2.18.x.

Matthias Kuhn suggested adding usesgeometry=True to the decorator but that seems not to help.

Full discussion can be found at https://gis.stackexchange.com/questions/232006/cant-select-using-a-custom-function-in-qgis-2-18-3

Associated revisions

Revision 90e91448
Added by Matthias Kuhn about 7 years ago

Fetch geometries when required by expression filter

Fix #16358

History

#1 Updated by Anonymous about 7 years ago

  • Status changed from Open to Closed

Also available in: Atom PDF