I am curious about field calculator and expression builder language in QGIS.
For example, $area
returns the area of the 'current feature'. Does 'current feature' refer to all features of a shapefile that is loaded in the workspace?
QGIS – Understanding ‘Current Feature’ in Field Calculator and Expression Builder
expressionfield-calculatorqgis
Related Question
- QGIS – Temporarily Disabling Preview in Expression String Builder
- QGIS Field Calculator – How to Copy Field Expression in QGIS Field Calculator
- QGIS – How to Sum Areas of Polygon Features Using array_foreach Function
- QGIS – Solve Problem with QGIS Expression Using overlay_nearest and Filter Condition
- QGIS Expression Builder – Assigning Specific Features in Expression Builder
Best Answer
The current feature is the one you're doing the calculation for. If you e.g. selected a single feature on the layer and choose to only updated selected features, the area is only calculated for that feature. If you run the calculation for the whole layer, the area is calculated for each feature and attached as an attribute to that feature. Meaning, the value in the column
area
of feature 5 is the actual area of said feature, and not the area of e.g. feature 23.Different from that, some expressions, e.g.
sum()
, calculate something with is not only represented by a single feature.