This is an old revision of the document!


PHP's gd library is missing or unable to create PNG images

Calculate Map

Description

Computes a new continuous raster map by evaluating an algebraic or logical expression independently for every cell in the output map. The expression result is always computed as a real (floating-point) value and then converted to the output map's chosen Cell Type.

Calculate Map is one of five functors in the calculator family. Use it when the expression produces continuous or measured values. If the expression produces integer class codes that should be treated as categories by downstream functors, use Calculate Categorical Map instead.

The abbreviated syntax (also called shorthand) for this functor is #. See Calculator functor shorthand in the EGO Script documentation for the full syntax of both the verbose and abbreviated forms, and Calculate Functors — Complete Operator Documentation for the complete expression language reference.

Inputs

Name Type Description
Expression Image Expression Type The algebraic or logical formula used to compute each output cell, written using the image expression editor. Must be enclosed in square brackets [ ] in EGO Script.

Optional Inputs

Name Type Default Description
Cell Type Cell Type Type Signed 32-bit Integer Data type for each output cell (e.g., byte, int16, float32).
Null Value Null Value Type Based on Cell Type Sentinel value representing “no data” in the output.
Result Is Sparse Boolean Value Type False If true, only non-null cells are stored in memory — saves memory but slows random access.
Result Format Map Type None Optional reference map whose spatial format (extent, resolution, projection) is applied to the output. Category information in the reference map is ignored.

Outputs

Name Type Description
Result Map Type The computed continuous output map.

Group

Notes

Connecting data inputs

All maps, tables, and scalar values referenced in the expression must be connected to the functor's ports before writing the expression, using hook functors:

  • Maps → Number Map → referenced in the expression as i1, i2, …, i100
  • Tables and lookup tables → Number Table → referenced as t1, t2, …, t100
  • Scalar values → Number Value → referenced as v1, v2, …, v100

In the abbreviated syntax, operands are referenced directly by the variable name they are bound to, prefixed with # for maps, % for tables, and $ for values — eliminating the hook block entirely.

Spatial context and image virtualization

The expression is evaluated independently once per cell across the output map. Two spatial keywords are available inside the expression:

  • line — the row index of the current cell, starting at 1
  • column — the column index of the current cell, starting at 1

When the expression references more than one map, all of them are evaluated at the same current celli1 and i2 always refer to the same spatial location. Connected maps do not need matching extent, resolution, or pixel dimensions: Dinamica EGO reconciles this automatically through image virtualization, transparently wrapping each input in a virtual version sharing a common extent and the highest resolution among the inputs. The one requirement that virtualization does not relax is projection — all connected maps must share the same projection.

Available expression features

All expression language features are available in Calculate Map — there are no restrictions. For the full operator reference, see The Expression Language in the Calculate Functors documentation, or the Image Expression Type page for the GUI editor and a navigable operator index.

Null value handling

Null propagation, the two map-calculator exceptions (iX[LINE, COL] returning 0 and neighbourhood functions excluding nulls), and defensive patterns are covered in Null Value Handling in the Calculate Functors documentation. If the computed result exceeds the range of the chosen Cell Type, that cell is also written as null rather than wrapping or clipping.

Performance

Expression calculations can be compiled to native code automatically (requires the optional native expression support package), delivering near-C performance without any change to the model.

Internal Name

CalculateMap

Usage examples