The Calculator tool allows you to perform calculations on the basis of existing raster cell values. The results are written to a new raster layer with formats supported in MapInfo Pro Advanced.
To use the Calculator:
-
On the RASTER tab, in the Operations group, click Raster Operations and then click the Calculator
button to open the Calculator dialog box.
On the Calculator window, you will see the following:
- The Expressions drop-down list contains standard grid calculator expressions like adding two inputs, multiplying two inputs, subtracting two inputs, etc.
- The Operators drop-down list contains arithmetic, and conditional and logical operators.
- The Functions drop-down list contains mathematical, raster statistics, and logical and conditional functions.
- Click New in the Input section to add an input raster file. You will see the raster alias(es) list. From the Input_1 drop-down list, select a file along with the desired field, if the input file has multiple fields. To add another input click New again in the Input section and select the desired file from the drop-down list.
- To add a variable, click the Variable tab and assign a variable to Variable_1.
-
In the Expression Editor window, select an expression from the Expressions drop-down list.
You will see the selection expression in the Expression Editor, as shown below:
-
Expand More Options and select one of the following.
- Override Output Field Type - Select Override Output Field Type to create output data in the specified raster type such as continuous, classified or imagery.
- Output Band data type - Select Output Band data type to create output data having specified band/stored data type. For example, if you select Automatic, output data type would be similar to input data type.
- Strict Null Handling - Select Strict Null Handling to create output data having NULL where input data is NULL. By default, it is true which means the NULL cells in the input raster will not be evaluated and will always be set to NULL in the output raster. If it is set to false, then the calculator expressions will be evaluated even for input raster cells with NULL values.
- Output Extent Covers Input - By default, it is true which means the calculator creates an output raster which has the same extents as the primary input raster. If it is set to false, it extends the output raster to cover all input rasters. The Strict Null Handling and Output Extent Covers Input options work together to allow a “union” of multiple rasters in the output, similar to merging the rasters with the Merge tool.
- Clip Extent - Specify the data extent that you want to perform the operation on.
- In the Output File box enter the name you want to specify for your output file. Click to browse to the location in your computer to save the output file and select the required output file format.
- Click Output Settings to control the following. The output settings can be controlled by the values set in the Raster Preferences, however, you can override those settings before executing the operation.
- Display Output File - Select the check-box, if you want to open the output file in the Map window on completion of the operation. You can configure to make this the default behavior from the Raster Preferences dialog.
- Compression Settings - If the file format to be saved is an MRR or TIFF, the compression settings options will appear. You can choose one from Data Balanced, Data Speed, or Data Space. Choose Advanced option to set your advance compression options such as compression method, level, and encoding type. For details, see Compression Settings.
- Data Balanced
- Data Speed
- Data Space
- Compression- Select a suitable compression method and level for the data. For more information on compression, see Compression methods.
- Encoding Type - Select a suitable Encoding Type for the data from the list. This drop-down list lets you select the default Encoding Type when saving a raster to MRR format. It enables you to compress the data when saving a raster to MRR format. Encoding Type is enabled only when the raster field type is Continuous and the compression method is lossless such as ZIP, LZMA or LZ4. The drop-down list contains the following:
- None - No encoding.
- Previous Column Linear - Linear estimation of the value from previous two columns.
- Previous Column Value - Predicts the value from previous column.
- Click Output Settings to control the following. The output settings can be controlled by the values set in the Raster Preferences, however, you can override those settings before executing the operation.
- Click Compute to create the raster based on the input expression.
The new raster, based on the expression, appears in the Map window.
Related reference