Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
calculate_map [2011/11/17 00:46] hermann [Optional Inputs] |
calculate_map [2013/08/13 20:07] 127.0.0.1 external edit |
||
---|---|---|---|
Line 14: | Line 14: | ||
^ Name ^ Type ^ Description ^ Default Value ^ | ^ Name ^ Type ^ Description ^ Default Value ^ | ||
| Cell Type | [[Cell Type Type | Cell Type]] | Data cell type | Signed 32 Bit Integer | | | Cell Type | [[Cell Type Type | Cell Type]] | Data cell type | Signed 32 Bit Integer | | ||
- | | Null Value | [[Null Value Type | Null Value]] | Null value | -2147483648 | | + | | Null Value | [[Null Value Type | Null Value]] | Null value | Default((Based on the value of the Cell Type input.)) | |
- | | Result Is Sparse | [[Bool Type | Bool]] | If true, the resulting map is created as a sparse image. Sparse images have the advantage of storing only the cells containing non-null values, but they have diminished access time. | False | | + | | Result Is Sparse | [[Bool Type | Bool]] | If true, the resulting map is created as a sparse image. Sparse images have the advantage of storing only the cells containing non-null values, but they have diminished access time. | False | |
+ | | Result Format | [[Map Type| Map]] | Map representing the output format. Any category information presents in the given map is not used as part of the map format. | None | | ||
===== Outputs ===== | ===== Outputs ===== | ||
Line 30: | Line 30: | ||
The expression result is calculated as a real value and converted to the data cell type of the output map. | The expression result is calculated as a real value and converted to the data cell type of the output map. | ||
- | If the calculation of the expression diverges or if the data cell type is not large enough, the corresponding cell is filled with the null value. | + | If the calculation of the expression diverges, the corresponding cell is filled with the null value. In practice, it means that every time a null value is found in a expression calculation, the calculation results in null value, unless the occurrence of the null value is isolated from the rest of the expression by a special operator like ''[[image_expression_type#image_operators_and_functions|isNull()]]'' or ''[[image_expression_type#general_operators|?]]''. |
+ | |||
+ | The examples below illustrates: | ||
+ | |||
+ | ^ Example ^ Analysis ^ | ||
+ | | <code cpp>i1 / 0</code> | The expression always results in null value (division by zero). | | ||
+ | | <code cpp>i1 + i2 / i3 ^ 3</code> | If the current cell of any of the images involved in the calculation is null value, the expression results in null value . | | ||
+ | | <code cpp>if isNull(i1) then | ||
+ | 1 | ||
+ | else | ||
+ | 2 | ||
+ | </code> | The expression never results in null value. | | ||
+ | | <code cpp>if isNull(i1) then | ||
+ | i2 | ||
+ | else | ||
+ | i3 | ||
+ | </code> | The expression might result in null value depending on the the value of i2 and i3. | | ||
+ | | <code cpp>(100 / i2) ? 0</code> | The expression never results in null value. | | ||
+ | | <code cpp>(100 / i2) ? i1</code> | The expression might result in null value depending on the the value of i1. | | ||
+ | |||
+ | If the data cell type is not large enough, the corresponding cell is also filled with the null value. | ||
The list of mathematical and logical operators that can be employed in the logic/algebraic expression can be found in the [[Image Expression Type | image expression reference]]. | The list of mathematical and logical operators that can be employed in the logic/algebraic expression can be found in the [[Image Expression Type | image expression reference]]. | ||
Line 39: | Line 59: | ||
CalculateMap | CalculateMap | ||
- |