## Output Grid

 2 0 2 2 2 6 0 12 8 6 9 2 3 8

Figure 12: A local function multiplies the input grid by the multiplier grid to produce the output grid

Local functions are not limited to arithmetic computations. Trigonometric, exponential, and logarithmic and logical expressions are all acceptable for defining local functions.

### Focal Functions

Focal functions process cell data depending on the values of neighboring cells. For instance, computing the sum of a specified neighborhood and assigning the sum to the corresponding cell of the output grid is the "focal sum" function (Fig. 13). A 3 x 3 kernel defines neighborhood. For cells closer to the edge where the regular kernel is not available, a reduced kernel is used and the sum is computed accordingly. For instance, a 2 x 2 kernel adjusts the upper left corner cell. Thus, the sum of the four values, 2,0,2 and 3 yields 7, which becomes the value of this cell in the output grid. The value of the second row, second column, is the sum of nine elements, 2, 0, 1, 2, 3, 0, 4, 2 and 2, and the sum equals 16.

Output Grid

npul

Grid

2

0

1

1

2

3

0

4

4

2

2

3

1

1

3

 7 8 9 6 13 16 16 11 13 18 20 14 8 13 13 10

Figure 13: A Focal sum function sums the values of the specified neighborhood to produce the output grid

Another focal function is the mean of the specified neighborhood, the "focal mean" function. In the following example (Fig. 14), this function yields the mean of the eight adjacent cells and the center cell itself. This is the smoothing function to obtain the moving average in such a way that the value of each cell is changed into the average of the specified neighborhood.

Input Grid

2

0

1

1

2

3

0

4

4

2

2

3

1

1

3

 Output Grid 1.8 1.3 1.5 1.5 2.2 2.0 1.8 1.8 2.2 2.0 2.2 2.3 2.0 2.2 2.2 2.5

Figure 14: A Focal mean function computes the moving average of the specified neighborhood to produce the output grid

Other commonly employed focal functions include standard deviation (focal standard deviation), maximum (focal maximum), minimum (focal minimum), and range (focal range).

### Zonal Functions

Zonal functions process the data of a grid in such a way that cell of the same zone are analyzed as a group. A zone consists of a number of cells that may or may not be contiguous. A typical zonal function requires two grids -a zone grid, which defines the size, shape and location of each zone, and a value grid, which is to be processed for analysis. In the zone grid, cells of the same zone are coded with the same value, while zones are assigned different zone values.

Figure 15 illustrates an example of the zonal function. The objective of this function is to identify the zonal maximum for each zone. In the input zone grid, there are only three zones with values ranging from 1 to 3. The zone with a value of 1 has five cells, three at the upper right corner and two at the lower left corner. The procedure involves finding the maximum value among these cells from the value grid.

Zonal Max [

Zone Grid

2

2

1

1

2

3

3

1

3

2

1

1

2

1

2

3

4

5

6

7

8

1

2

3

4

5

5

5

 5 5 8 8 5 7 7 8 7 5 8 8 5 5

Figure 15: A Zonal maximum function identifies the maximum of each zone to produce the output grid

Typical zonal functions include zonal mean, zonal standard deviation, zonal sum, zonal minimum, zonal maximum, zonal range, and zonal variety. Other statistical and geometric properties may also be derived from additional zonal functions. For instance, the zonal perimeter function calculates the perimeter of each zone and assigns the returned value to each cell of the zone in the output grid.

### Global Functions

For global functions, the output value of each cell is a function of the entire grid. As an example, the Euclidean distance function computes the distance from each cell to the nearest source cell, where source cells are defined in an input grid. In a square grid, the distance between two orthogonal neighbors is equal to the size of a cell, or the distance between the centroid locations of adjacent cells. Likewise, the distance between two diagonal neighbors is equal to the cell size multiplied by the square root of 2. Distance between non-adjacent cells can be computed according to their row and column addresses.

In Figure 16, the grid at the left is the source grid in which two clusters of source cells exist. The source cells labeled 1 are the first clusters, and the cell labeled 2 is a single-cell source. The Euclidean distance from any source cell is always equal to 0. For any other cell, the output value is the distance from its nearest source cell.

Source Grid

1

1

1

2

Output Grid

 2 1 0 0 1.4 1 1 0 1 0 1 1 1.4 1 1.4 2

Figure 16: A Euclidean distance function computes the distance from the nearest source cell

In the above example, the measurement of the distance from any cell must include the entire source grid; therefore this analytical procedure is a global function.

Figure 17 provides an example of the cost distance function. The source grid is identical to that in the preceding illustration. However, this time a cost grid is employed to weigh travel cost. The value in each cell of the cost grid indicates the cost for traveling through that cell. Thus, the cost for traveling from the cell located in the first row, second column to its adjacent source cell to the right is half the cost of traveling through itself plus half the cost of traveling through the neighboring cell.

Figure 17 provides an example of the cost distance function. The source grid is identical to that in the preceding illustration. However, this time a cost grid is employed to weigh travel cost. The value in each cell of the cost grid indicates the cost for traveling through that cell. Thus, the cost for traveling from the cell located in the first row, second column to its adjacent source cell to the right is half the cost of traveling through itself plus half the cost of traveling through the neighboring cell.

Figure 17: Travel cost for each cell is derived from the distance to the nearest source cell weighted by a cost function

Another useful global function is the cost path function, which identifies the least cost path from each selected cell to its nearest source cell in terms of cost distance. These global functions are particularly useful for evaluating the connectivity of a landscape and the proximity of a cell to any given entities.

SOME IMPORTANT RASTER ANALYSIS OPERATIONS

In this section some of the important raster based analysis are dealt:

• Renumbering Areas in a Grid File

• Performing a Cost Surface Analysis

• Performing an Optimal Path Analysis

• Performing a Proximity Search

Area Numbering: Area Numbering assigns a unique attribute value to each area in a specified grid file. An area consists of two or more adjacent cells that have the same cell value or a single cell with no adjacent cell of the same value. To consider a group of cells with the same values beside each other, a cell must have a cell of the same value on at least one side of it horizontally or vertically (4-connectivity), or on at least one side horizontally, vertically, or diagonally (8-connectivity). Figure 18 shows a simple example of area numbering.

Figure 18. Illustrates simple example of Area numbering with a bit map as input. The pixels, which are connected, are assigned the same code. Different results are obtained when only the horizontal and vertical neighbors are considered (4-connected) or whether all neighbors are considered (8-connected)

Figure 18. Illustrates simple example of Area numbering with a bit map as input. The pixels, which are connected, are assigned the same code. Different results are obtained when only the horizontal and vertical neighbors are considered (4-connected) or whether all neighbors are considered (8-connected)

One can renumber all of the areas in a grid, or you can renumber only those areas that have one or more specific values. If you renumber all of the areas, Area Number assigns a value of 1 to the first area located. It then assigns a value of 2 to the second area, and continues this reassignment method until all of the areas are renumbered. When you renumber areas that contain a specified value (such as 13), the first such area is assigned the maximum grid value plus 1. For example, if the maximum grid value is 25, Area Number assigns a value of 26 to the first area, a value of 27 to the second area, and continues until all of the areas that contain the specified values are renumbered.

Cost Surface Analysis: Cost Surface generates a grid in which each grid cell represents the cost to travel to that grid cell from the nearest of one or more start locations. The cost of traveling to a given cell is determined from a weight grid file. Zero Weights option uses attribute values of 0 as the start locations. The By Row/Column option uses the specified row and column location as the start location.

Optimal Path: Optimal Path lets us analyze a grid file to find the best path between a specified location and the closest start location as used in generating a cost surface. The computation is based on a cost surface file that you generate with Cost Surface.

One must specify the start location by row and column. The zeros in the input cost surface represent one endpoint. The specified start location represents the other endpoint.

Testing the values of neighboring cells for the smallest value generates the path. When the smallest value is found, the path moves to that location, where it repeats the process to move the next cell. The output is the path of least resistance between two points, with the least expensive, but not necessarily the straightest, line between two endpoints. The output file consists of only the output path attribute value, which can be optionally specified, surrounded by void values.

Performing A Proximity Search: Proximity lets you search a grid file for all the occurrences of a cell value or a feature within either a specified distance or a specified number of cells from the origin.

You can set both the origin and the target to a single value or a set of values. The number of cells to find can also be limited. For example, if you specify to find 10 cells, the search stops when 10 occurrences of the cell have been found within the specified distance of each origin value. If you do not limit the number of cells, the search continues until all target values are located.

The output grid file has the user-type code and the data-type code of the input file. The gird-cell values in the output file indicate whether the grid cell corresponds to an origin value, the value searched for and located within the specified target, or neither of these.

The origin and target values may be retained as the original values or specified to be another value.

0 0