Band math
Evaluates your own expression over named bands: arithmetic, comparisons, a conditional, and a short list of functions, parsed and evaluated in the core rather than by a JavaScript evaluator.
Experimental: not yet fully verified. How results are checked
The expression comes to 0.698113.
- Expression size
Provenance
- Computed by
- raster.index.band-math 1.0.0, core 0.1.0
- Model
- The expression is lexed and parsed into a tree, then evaluated in the core; identifiers are the bands given and the functions abs, sqrt, log, exp, min, max, and clamp, and nothing else
- Accuracy
- Exact double-precision arithmetic in the order the expression is written.
- Notes
- 1 shown with the answer
- Cites
- Institute of Electrical and Electronics Engineers, IEEE Standard for Floating-Point Arithmetic (IEEE 754)
Something look off?
How we got thisFormula, worked example, sources, and proof
Model: The expression is lexed and parsed into a tree, then evaluated in the core; identifiers are the bands given and the functions abs, sqrt, log, exp, min, max, and clamp, and nothing else
Accuracy: Exact double-precision arithmetic in the order the expression is written.
When to use this: Use this for an index the catalog does not have, or a combination of your own: a ratio, a difference, a threshold, or a masked value written as a conditional. It is also the way to try a formula from a paper before deciding whether it deserves a tool of its own.
Limitations: It evaluates one pixel's values, not an image, and it has no no-data handling beyond refusing a result that is not finite. The language is deliberately small: no assignment, no loops, no user functions, and no way to reach anything outside the bands you pass, which is the point. An expression over about a thousand nodes is refused rather than evaluated.
Worked example: NDVI written by hand. Source: The NDVI definition written as band math: it gives the same 0.6981 as the NDVI tool. It is golden test vector v001, and every build checks the tool still gives its answer within its tolerance.
You enter
- Bands
- nir, 0.45 red, 0.08
- Expression
- (nir - red) / (nir + red)
You get
- Value
- 0.698113
- Expression size
- 7
Review: Not yet independently reviewed by a GIS professional.
Last verified: 2026-09-22, when a maintainer last confirmed this tool's sources at the issuer. See the sources ledger.
Status: version 1.0.0, core 0.1.0. See this tool in the verification report.
Checked against: 12 golden test vectors (download the test vectors, each with its source and tolerance). See how results are checked and every source.
Sources
- IEEE Standard for Floating-Point Arithmetic (IEEE 754), Institute of Electrical and Electronics Engineers, IEEE 754-2019. Binary64 arithmetic and the behavior of division by zero and of operations giving infinities or NaN.
Experimental means this tool has not yet met the stable bar: at least 20 golden vectors, differential tests, and an independent worked example.