Feature selection using custom python expression functions #24333
Labels
Bug
Either a bug report, or a bug fix. Let's hope for the latter!
Expressions
Related to the QGIS expression engine or specific expression functions
Author Name: Simran Khare (Simran Khare)
Original Redmine Issue: 16424
Affected QGIS version: 2.18.5
Redmine category:expressions
This is regarding selecting features by expression in QGIS 2.18.x. The selection does not seem to work when we try to access the feature attributes in our custom expression function.
For example, we would expect the following function to select all features with non-null osm_ids. Upon executing the function in the expression engine, the output preview is 'true', but no features are selected.
@qgsfunction(args=0, group='Custom')
def fun3(value1, feature, parent):
if feature['osm_id']:
return True
else:
return False
The above function works fine in QGIS 2.14.12, but not in 2.18.5.
Attached is the pbf file and some Python functions I tested with. Please add the point vector layer from 'tulersee.pbf' and call fun3() to reproduce the error.
The text was updated successfully, but these errors were encountered: