Thursday 12 January 2017

qgis - QgsExpression to apply on feature


I am using QGIS 2.8. For the documentation of QgsExpression I see the evaluate method on feature as deprecated. What am i supposed to use instead of this methods ? I have some expression and need to check if expression evaluate to True or False on given feature.


enter image description here



Answer




You're looking at the docs for >= 2.12, not 2.8. That's the correct method to use for the QGIS 2.0 series, but in QGIS 3.0 you'll need to use the method which takes a QgsExpressionContext argument. That's only available in QGIS 2.12 and up.


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...