Grid computing is the most commonly used method in data processing and analysis of raster numbers in spatial analysis, it is widely used to solve various types of problems, especially, it is the basic module of building a complex applied mathematical model. ArcGIS 9 provides a very friendly graphical raster calculator that makes it easy to complete raster operations based on mathematical operators, as well as raster operations based on mathematical functions, using the raster calculator, and it also supports direct invocation of ArcGIS's own raster data spatial analysis functions. And it can easily implement the simultaneous input and operation of multiple statements.
A mathematical operation
The mathematical operation is mainly for two or more raster data with the same input unit is calculated by grid. It consists of three sets of mathematical operators: arithmetic operators, Boolean operators, and relational operators.
1. Arithmetic operations
Arithmetic operations mainly include addition, subtraction, multiplication, and the addition of four kinds. You can add, subtract, multiply, and divide directly between two or more raster data relative units.
For example, based on the rainfall data for this year and last year, the variation in last year's precipitation was calculated by using the formula (precipitation last year)/last year's rainfall, 8.65. (Unit: MM)
Figure 1 Arithmetic operations
2. Boolean operations
Boolean operations mainly include: and (and), or (or), XOR (XOR), non (not). It is based on Boolean operations to determine the raster data. After judgment, if true, the output is 1, and if False, the output is 0.
(1) and (&): Compares two or more raster data layers, if the corresponding raster values are not 0 values, the output is true (Assignment is 1), otherwise the output is False (Assignment is 0).
(2) or (|) : Compares two or more raster data layers, where one or more of the corresponding raster values are not 0 values, the output is true (Assignment is 1), otherwise the output is False (Assignment is 0).
(3) XOR (!) : Compares two or more raster data layers, if the corresponding raster values are not identical in logic (one is 0 and one must be 0), the output is true (Assignment is 1), otherwise the output is False (Assignment is 0).
(4) Non (^): A logical "not" operation on a raster data layer. If the grid value is 0, the output is 1, and if the raster value is not 0, the output is 0.
For example, based on past and present surface types, it is explained that "and" are used to extract the surface of the land that has never been desertified, 2 (where deserts are 0 and other values represent different surface types).
Figure 2 Boolean operation
3. Relational operations
The relationship operation is based on a certain relationship condition, which accords with the condition of true, gives 1 value, and gives 0 value by false condition. There are six types of relational operators: =,<,>,<>,>=,<=.
For example, you need to extract areas between 20 degrees and 30 degrees (including 20 and 30 degrees), with the formula: <= [temperature] <= 30.
Two-function operation
In addition to providing simple mathematical operators for raster computing, the raster calculator also provides a number of relatively complex function operations, including mathematical function operations and raster data spatial analysis function operations. Mathematical functions include: arithmetic function, trigonometric function, logarithmic function and power function.
1. Arithmetic Functions (arithmetic)
The arithmetic functions mainly include six kinds: Abs (absolute value function), Int (integer function), float (floating point function), ceil (rounding function up), floor (rounded down function), Isnul (the input data is null data is output by 1, there is data with 0 output).
2. Trigonometric Functions (trigonometric)
Common trigonometric functions include: sin (sine function), Cos (cosine function), Tan (tangent function), Asin (inverse chord function), Acos (cosine function), Atan (inverse tangent function).
3. Logarithmic function (logarithms)
A logarithmic function can perform a logarithmic or exponential operation on the input grid numbers. The reference parts include: Exp (base e), Exp10 (base 10), EXP2 (2) Three, the number of parts including: log (natural logarithm), LOG10 (10), log2 (base 2) and other three.
4. Power function (Powers)
The power function can be used to calculate the power function of the input grid numbers. The power function consists of three kinds: Sqrt (square root), SQR (square), Pow (Power).
5. Raster Data Spatial analysis functions
The raster calculator also directly supports most of the raster data analysis and processing functions that ArcGIS comes with, such as slope, hillshade in raster surface analysis
Functions, etc., are not listed here, please refer to the relevant documentation for specific usage. Unlike mathematical functions, these functions do not appear in the Raster Calculator graphical interface, but are manually entered by the evaluator himself.
Three Grid calculator
1. Start the grid calculator
Click the spatial Analyst's drop-down arrow and select Raster Calculator. The raster calculator consists of four parts (Figure 3), the upper left Layers selection box is the list of all the raster data layers that have been loaded in the current ArcMap attempt, double-clicking any of the data layer names, which can be automatically added to the Equation Editor at the lower left, the upper middle part is the usual arithmetic operator, 0~10, Decimal points., relationships, and logical operators panel, click the button you want, and the button content is automatically added to the Equation Editor. The right retractable area is a common math function panel, and the button content is automatically added to the Equation Editor by clicking any button.
2. Edit the calculation formula
(1) Simple arithmetic operation
As shown in 3, enter the calculation result name in the Equation Editor, enter the equal sign (a space is required on both sides of all symbols), and then double-click the layer you want to use to calculate in the layers bar, then the selected layer will enter the Equation Editor to participate in the operation. Where "-" and "^" are single-mesh operators, the operators can be used without content, but only after the operators to participate in the calculation of the object, such as a =-[slope] and so on. In the formula editor, if you reference the data layer of the layers selection box, the data layer name must be enclosed in [].
Figure 3 Mathematical arithmetic operation of Grid calculator
Figure 4 Mathematical function operation of Raster calculator
(2) Mathematical function operation
The math function operation needs to note that it needs to click the Function button First, and then add the calculated object in parentheses after the function, as shown in 4. It should be noted that trigonometric functions are in radians as their default units of calculation.
(3) Raster data spatial analysis function operation
Raster data spatial analysis functions do not appear directly in the Raster calculator panel, so they need to be manually entered by the evaluator themselves. When you need to refer to them, you must first consult the relevant documents to find out their full names, parameters, referenced grammar rules, and so on. Then enter the full name of the function in the raster calculator, enter a pair of parentheses, and enter the relevant parameter or calculated object in parentheses, as shown in 5.
Figure 5 Raster data spatial analysis function operations
(4) Editing of multiple statements
ArcGIS Raster Calculator Multiple expressions are entered at the same time, and the result of an expression that is entered first can be directly referenced by subsequent statements, as shown in 6. An expression must be entered in a single line and cannot be returned in the middle. In addition, if the post-input function needs to reference the result of the preceding expression, the preceding expression must be a complete mathematical expression, "d = [straightline]*100" In 8.70, the output data file name to the left of the equals sign, and the formula on the right. In addition, when referencing the output object of the previous expression, the name of the output object is directly referenced, and the object name does not need to be enclosed in brackets, such as d in e = d >= 2500.
Figure 6 Multi-statement editing of the raster calculator
3. After checking that the calculation formula is correct, click Evaluate to complete the calculation and the result will be automatically loaded into the current ArcMap view window.
ArcGIS Tutorial: Raster calculations in ArcGIS