Attribute calculation — Operator family

Attribute calculation Operators derive new values from the attributes and geometry of each feature, or from the values of each raster cell, without moving anything: a 0/1 indicator from a code, an area from a geometry, a density from a count and an area, a total over a group. They are how register codes become the variables an analysis needs.

Part of the Operators families. Used in: Categories from register codes (Task), Aggregating points to zones (Task), Habitat network (Task), Vegetation index from satellite imagery (Task).

Derive a value per feature

Operator Schema: a new field computed from other fields and the geometry of the same feature: a recoding (if(code = 1, 1, 0)), a ratio, an area ($area), a length.

Choices to record: what the new value means, its unit, and what happens to empty values (a NULL in, a NULL out, unless you decide otherwise with coalesce).

Tools: QGIS Field calculator (Tool - QGIS).

Indicator (0/1) variable

Operator Schema: a category turned into 1 (has it) and 0 (does not). The sum of an indicator over a zone is a count, and its mean is a share. That makes any tool that sums or averages compute counts and shares of a category.

Choices to record: which codes count as 1, and whether “unknown” or “not in use” counts as 0 (it stays in the denominator) or is left out.

Tools: QGIS Field calculator (Tool - QGIS).

Aggregate over a group

Operator Schema: a value per feature computed from all features that share a group value: the number of patches in a cluster, the area of a cluster, a feature’s share of its group’s total.

Tools: QGIS Field calculator (Tool - QGIS) with aggregate expressions such as count($id, group_by:="cluster_id").

Map algebra (per cell)

Operator Schema: a new raster computed cell by cell from one or more rasters on the same grid: arithmetic between bands (a vegetation index such as NDVI), a condition that keeps or removes cells (a mask: if(cloud = 0, value, nodata)), a rescaling (reflectance × 10,000 to reflectance).

Choices to record: the formula and the meaning and unit of the result; the grid (cell size, extent, alignment) the inputs share or are resampled to; the data type the calculation uses (integers can overflow or be divided as integers); what happens to NoData and to division by zero.

Tools: QGIS Raster calculator (Tool - QGIS).