Skip to content
Discussion options

You must be logged in to vote

Thanks for following up, and sorry the model part of #2334 went unanswered.

Area in a model. Inside a model, the Field Calculator is Whitebox's Field Calculator, not the one in the attribute table, and it uses a different syntax: $area is a variable, not a function, so it takes no parentheses. $area("hectares") and $area() both produce exactly the error you're seeing. This works:

my_field_A * $area

However, $area is measured in the layer's coordinate units, and GeoLibre layers are in longitude/latitude (EPSG:4326), so it returns square degrees, which isn't useful. The reliable approach is to add one step before the Field Calculator:

  1. Add Add Geometry Attributes to the model and connect y…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by giswqs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants