SAGA-GIS Module Library Documentation (v2.2.3)

Module Table Calculator

The table calculator calculates a new attribute from existing attributes based on a mathematical formula. Attributes are addressed by the character 'f' (for 'field') followed by the field number (i.e.: f1, f2, ..., fn) or by the field name in square brackets (e.g.: [Field Name]).
Examples:
sin(f1) * f2 + f3
[Population] / [Area]

The following operators are available for the formula definition:
+ Addition
- Subtraction
* Multiplication
/ Division
^ power
abs(x) - absolute value
sqr(x) - square
sqrt(x) - square root
ln(x) - natural logarithm
log(x) - base 10 logarithm
exp(x) - exponential
pow(x, y) - power with mantisse x and exponent y
sin(x) - sine
cos(x) - cosine
tan(x) - tangent
asin(x) - arcsine
acos(x) - arccosine
atan(x) - arctangent
atan2(x, y) - arctangent of x/y
gt(x, y) - the result is 1.0, if x is greater than y else 0.0
x > y - the result is 1.0, if x is greater than y else 0.0
lt(x, y) - the result is 1.0, if x is less than y, else 0.0
x < y - the result is 1.0, if x is less than y, else 0.0
eq(x, y) - the result is 1.0, if x equals y, else 0.0
x = y - the result is 1.0, if x equals y, else 0.0
mod(x, y) - returns the floating point remainder of x/y
ifelse(c, x, y) - if condition c is not 0.0 the result is x, else y
int(x) - integer part of floating point value x
pi() - returns the value of Pi

Parameters

 NameTypeIdentifierDescriptionConstraints
InputTableTable (input)TABLE--
OutputResult (*)Table (optional output)RESULT--
OptionsFormulaTextFORMULA-Default: f1 + f2
Field NameTextNAME-Default: Calculation
Field (*)Table fieldFIELD--
(*) optional

Command-line

Usage: saga_cmd table_calculus 1 [-FORMULA <str>] [-NAME <str>] [-TABLE <str>] [-RESULT <str>] [-FIELD <str>]
  -FORMULA:<str>	Formula
	Text
	Default: f1 + f2
  -NAME:<str>   	Field Name
	Text
	Default: Calculation
  -TABLE:<str>  	Table
	Table (input)
  -RESULT:<str> 	Result
	Table (optional output)
  -FIELD:<str>  	Field
	Table field