![]() Introduction to Geographic Information Systems in Forest Resources |
|
|||||||||||||||||
|
|||||||||||||||||
Discussion:
Raster analysis is similar in many ways to vector analysis. However, there are some key differences. The major differences between raster and vector modeling are dependent on the nature of the data models themselves. In both raster and vector analysis, all operations are possible because data sets are stored in a common coordinate framework. Every coordinate in the planar section falls within or in proximity to an existing feature, whether that feature is a point, line, polygon, or raster cell.
In vector analysis, all operations are possible because features in one theme are located by their position in explicit relation to existing features in other themes. Inherent in the arc-node vector data model is chiralty, or left- and right-handedness of arcs (as shown in the polygon data model image from Spatial Data Model). As a corollary to this, containment and overlap are inherent relationships between themes. For example, a point on one theme is on one side of an arc in another theme, or inside or outside of a polygon in yet another theme. The complexity of the vector data model makes for quite complex and hardware-intensive operations.
Raster analysis, on the other hand, enforces its spatial relationships solely on the location of the cell. Raster operations performed on multiple input raster data sets generally output cell values that are the result of computations on a cell-by-cell basis. The value of the output for one cell is usually independent of the value or location of other input or output cells. In some cases, output cell values are influenced by neighboring cells or groups of cells, such as in focal functions.
Raster data are especially suited to continuous data. Continuous data change smoothly across a landscape or surface. Phenomena such as chemical concentration, slope, elevation, and aspect are dealt with in raster data structures far better than in vector data structures. Because of this, many analyses are better suited or only possible with raster data. This section and the next section will explain the fundamentals of raster data processing, as well as some of the more common analytical tools.
ArcView can deal with several formats of raster data. Although ArcView can load all supported raster data types as images, analysis can only be performed on ArcInfo format grids. Because the native raster data set in ArcView is the ArcInfo format grid, from this point on, the term grid will mean the analytically enabled raster data set.
ArcView's interface to raster analysis is through the Spatial Analyst Extension. The Spatial Analyst, when loaded, provides additions to the ArcView GUI, including new menus, buttons, and tools. The features added to ArcView with the Spatial Analyst are listed here.
Grid themes
Overview Grid theme properties Adding grid themes to views Displaying grid themes Examining cell values in grid themes Managing grid theme files
Setting grid theme and analysis properties
Cell size Analysis extent Masking Projections and grid themes
Grid function types
Global functions Zonal functions Focal functions
Performing grid analysis
Map Algebra The map calculator
Grid themes
Grid themes are graphical representations of the ArcView and ArcInfo implementation of the raster data model. Grid themes are stored with a numeric value for each cell. The numeric cell values are either integer or floating-point. Integer grids have integer values for the cells, whereas floating-point grids have value attributes containing decimal places.
Cell values may be stored in summary tables known as Value Attribute Tables (VATs) within the info subdirectory of the working directory. Because the possible number of unique values in floating-point grids is high, VATs are not built or available for floating-point grids.
VATs will exist for integer grids that have:
It is possible to convert floating-point grids to integer grids, and vice versa, but this frequently leads to a loss of information. For example, if your data have very precise measurements representing soil pH, and the values are converted from decimal to integer, zones which were formerly distinct from each other will become indistinguishable.
Grid zones are groups of either contiguous or noncontiguous cells having the same value.
Although Map Queries (which will be discussed shortly) can be performed on both integer and floating-point grids, normal feature or table queries are only possible on integer grids with VATs. This is because a normal feature query is dependent on the existence of a theme table. Those grids without VATs have no theme tables, and are therefore unavailable for normal queries.
Grid theme properties can be determined by selecting Theme > Properties from the View GUI menu while a grid theme is active. The Theme Properties dialog shows the Theme Name as it appears in the Table of Contents, the Source file location, the Cell Size, the number of Rows and Columns, the lower-left and upper-right coordinates, the grid Type (Float or Integer), and the Status (Temporary or Permanent).
Grid themes are added to views in the same manner as feature or image themes,
by using the View > Add Theme menu control, or the Add Theme
button.
. In the Data Source
Types dropdown list, select Grid Data Source. The list of themes
will be updated to include only grid data themes.
However, in order to load grid themes into a view within the project, the Spatial Analyst Extension must be loaded.

If the Spatial Analyst Extension is not loaded, it is still possible to add grid data sources to a view, but only as simple images. Image themes cannot be queried or analyzed in any way. Image themes are not associated with any attribute values, other than a simple numeric value used for color mapping.
Grid theme displays are altered in exactly the same manner as feature themes. Changes to the display of grid themes are done using the Legend Editor. Like polygon feature themes, shading of fills can be changed by altering the symbols of individual classes, by changing the Color Ramp, legend labels, and classification properties.
Here, the Pack Forest elevation floating-point elevation grid is displayed with in 10 equal-interval, natural breaks classes, with the Yellow to Green to Dark Blue Color Ramp. Note that the No Data class is included in the 10 classes.
Now the legend has been changed to three equal-interval natural breaks classes, with customized legend colors and labels.
To see the spread of values for a grid, use the Histogram button
. This will calculate a temporary frequency
distribution summary table based on the current number of classes displayed
for the theme. The summary table uses the Value field as the summary
item. The summary table is not added to the project, but a simple chart based
on the summary table is added to the project. A histogram of the grid theme
will give you an idea of the range of values in the grid, as well as the relative
frequency of each of the classes. Here is a histogram based on the 10-class
elevation grid:
It is possible to display a histogram of cells overlapping selected features from other themes. Here are two selected forest stand polygons, and a histogram for the elevations of cells within each stand.

For all grid themes, individual cell values can be queried using the Identify
tool
. Clicking on a cell
for the active grid theme will display the attribute values for the theme. The
Identify Results dialog will display the name of the grid theme, the
X and Y coordinates of the cell, and the cell's value.
For integer themes with VATs, it is possible to perform normal queries. Here are all cells with an elevation greater than 2000 feet.
As with normal feature theme queries, cells meeting the query criteria are displayed in the default selection color.
When the Spatial Analyst performs operations that create new grids on the fly, these new grids are by default stored in the working directory temporarily. If the theme is deleted from the view, the grid will also be deleted from the disk. Frequently, grid queries and analyses are not formatted properly in order to obtain the desired result. The incorrect grid can be deleted from the project, and it will also be removed from the file system (unlike shapefiles, which need to be manually deleted). After the correct result is obtained, the new temporary grid can be saved permanently. In order to make sure that newly created grids are saved, either save the project or select Theme > Save Data Set from the menu. When you do save grid themes, you can choose the file system directory and the name of the theme, rather than accepting the default name and location of the data set assigned by ArcView.
If you have temporary grids in a project, and the project is saved, those grids will become permanent. This means that if you remove the grid theme from the project, it will not be automatically deleted from the disk; you will need to manually delete in the same manner that you manually delete shapefiles. Be aware of this, because grid data set files are very large in size, and can easily fill up a drive, especially a puny 100 MB Zip drive.
If you do need to manage grid data sets, you can use the File > Manage Data Sources choice in the View menu. This tool allows you to copy, rename, and delete grids in the same way you have used it to manage shapefiles. Grids can be copied or moved to different names, or to different places in the file system. You can use this functionality to save shapefiles or grids from non-writeable media (e.g., the CD) to other places on the file system without having to add the theme and then save it to disk.
In order to be able to copy, rename, or delete a theme, all references to the theme must be removed from the project. Sometimes, even if the theme is removed from the view and the theme table is deleted, ArcView "holds on" to a theme. In these cases, it becomes necessary to completely close a project, then open a new project, and manage data sources in the new project.
Setting grid theme and analysis properties
When new grids are created by spatial analysis operations, the user can choose some of the output properties of the created grid. The properties are set by selecting Analysis > Properties from the menu. After the analysis properties are set, and the project is saved, the same properties will be used for every analysis within the view whose Analysis Properties were set.
The various Analysis Properties can be copied from existing themes, or entered manually.
The spatial extent of the analysis determines how large (spatially) the output grid will be. It is possible to set the analysis extent manually to any valid coordinates, to the view's or display's extent, or to the spatial extent of a theme within the view.
Output data will be generated only for the cells within the Analysis Extent. This is frequently used when you are interested in analyzing a small area, rather than performing the operation over the entire study area. The Analysis Extent is a simple rectangle. If you wish to limit the output to match a specific shape of an existing grid, use a Mask.
You should also beware that altering the analysis extent may also alter the registration of grids. If you create a new grid from an existing grid, but with a different analysis extent (even if the cell size is the same), the two grids will not overlay properly unless the analysis extent has an origin that is located at a cell corner for the original grid. This can have significant effects on further processing, calculations, and measurements.
Although acting on a smaller analysis extent can speed things up quite a bit, you should keep a single analysis extent for all processing if you can afford the time.
Existing grids are stored with a certain known cell size. You can check the
cell size of any grid theme by making the grid theme active and choosing Theme
> Properties from the View GUI menu. It is preferable when performing
multi-grid analyses to choose an output cell size that is the same as the largest
of the input cell sizes. It is always possible to decrease information
content by resampling cells to a larger cell size, but it is impossible to increase
information content by splitting cells. Because the individual cell is the smallest
resolvable feature in a grid, although the software will allow it, it is ill-advised
to subdivide the cell into different values.
Remember that cell size is the measurement of the edge of a single cell, not
the area of a cell. Also remember that cell size is stored in the map units
for the data set. For the Pack Forest data, that unit is always feet.
The number of rows and columns can be automatically determined by the combination of cell size and bounding coordinates. Or the number of rows and columns can be set manually, in which case the cell size will change to accommodate the new number of rows and columns.
Mask grids can be used to limit the spatial output to the non-null extent of an existing grid theme. Calculations will occur for the cell locations that have valid values in the mask grid. In the following example, I have selected three forest stands and converted these to a grid. This new grid is set as a mask grid, which means that processing will only take place within the area defined by these stands.
Here are the selected stands.
Now, here they are converted to a grid. Each cell's value is equal to the unique the internal ID number of the original stand, which creates three zones in the output grid. The new grid is rectangular in shape, but the cells outside the stand boundaries have null (No Data) values.
The grid in the above image is set as a mask grid, and a Euclidean distance analysis is performed on the stream line features. Only cells within the original stands have distance to streams calculated.
Projecting grids is very time consuming and computer-intensive, and is therefore not supported within ArcView. Although ArcView can project vector data on the fly, from geographic coordinates to any supported projection system, it cannot project raster data. Therefore, there are rules to follow when using grid data and other data sources.
There are three basic categories of functions for the creation of new grids: global, focal, and zonal.
Most grid operations perform their algorithm on every cell in the data set. You can think of the global function calculation engine as starting at once cell location, performing a calculation once on the inputs at that location, and then moving on to the next cell location, and so on.
Here is a global function, where the individual output grid cell values are the result of the global sine function performed on every input cell:
Most of the functions that create new grids based on analyses performed on vector themes are global functions.
Certain grid operations do consider neighborhoods, so that the output cell is the result of a calculation performed on either a group of cells determined by a window of cells (known as a kernel or focus) around the cell of interest. These operations are called focal functions. For example, a smoothing (low-pass filter) algorithm will take the mean value of a 3-x-3 cell kernel, and place the output value in the location of the central cell. If the kernel contains locations that are outside of the grid, these locations are not used in the calculation.
In this focal mean example, the outlined cells in the input grid are averaged, and the resultant value is placed in the center cell of the kernel in the output grid. This is done for every 3-x-3 neighborhood in the input.
Other operations perform functions based on a group of cells with a common value (a zone) in one of the inputs. The group of cells are known as zonal functions, since they calculate single output values for a group of cells based the location of the input zone.
Here, the zones are defined by the zone grid. The function is a zonal sum, which sums all the input cells per zone, and places the output in each corresponding zone cell in the output. The zone boundaries are included only for illustrative purposes, and are not actually part of the data set.
Raster analytical functions are performed by accessing functions contained within the Analysis and Surface menus in the View GUI while the Spatial Analyst Extension is loaded. We will cover various types of raster analysis in the next section.
Spatial Referencing
Raster analyses that use multiple grids are possible because of the spatial referencing of grids to a common coordinate space.

In the image above, a process uses 3 input grids and creates a single output grid. The analysis is performed on a cell-by-cell locational basis, where the calculation is performed on each value from the 3 input grids. Output from the calculation is placed at the same location in the output grid.
Map Algebra
For most grid functions, other than those which simply identify a selected group of cells, operations take the conceptual format of an algebraic expression. For this reason, the syntax of grid analytical operations is often referred to as "map algebra." Sometimes map algebra uses functional notation:
output_data_set = function (input_data_set(s) {,arguments})
For example, to generate a slope grid from an elevation grid, with values in percent:
slp_grid = slope (dem, percentrise)
Sometimes map algebra takes the form of arithmetic expressions:
output_data_set = input_grid1 operator input_grid2 ...
For example, to calculate the multiplication of the two input grids slp_grid and dem:
slp_dem = slp_grid * dem
Usually the input and output data sets are grids, but they can also be vector data sets, such as polygonal zones or isoline themes.
Map algebra statements and other analytical functions are created using special tools, such as the Map Calculator and Map Query, in the Spatial Analyst-enabled GUI.
The Map Calculator
The Map Calculator is the main interface for performing Map Algebra.

Here are images from 2 views that display the input and output of this analysis:


Note in the second image, the Map Calculation 1 grid has values that are 3 times the value of Dem.
The Map Calculator contains controls for selecting Layers (which can be thought of as values in the Map Algebra expression), Numbers, and Operators. There are different classes of operators (Arithmetic, Relational, Boolean, Logarithmic, Trigonometric, Powers). The expression area is where you build the Map Algebra expression, either by clicking on parts of the GUI, or by writing a valid Avenue-syntax expression.
The output of the Map Calculation is a temporary grid whose name is shown on the title bar of the Map Calculator. In the above example, the Map Calculation is equivalent to a Map Algebra arithmetic expression:
Map Calculation 1 = (dem * 3)
which essentially creates a new grid called Map Calculation 1 that is the result of multiplying the cell values in the dem grid by the constant value 3.
In our lab session we will also be using the Map Calculator to perform a Map Algebra function for mosaicing:

Translated to Map Algebra:
Map Calculation 1 = mosaic (eaton, elbe)
Which essentially creates a new grid called Map Calculation 1 that is the result of performing the mosaic function on the elbe and eaton grids.
Here is the result of this analysis:


In the first image, 2 separate grids exist. After the Mosaic operation, Map Calculation 1 includes all cells from the 2 inputs, and the black No Data cells that previously existed as overlap between the input grids is gone.
|
|||||||||||||||||
|
The University of Washington Spatial Technology, GIS, and Remote Sensing Page is provided by the College of Forest Resources and the College of Ocean and Fisheries Sciences through Unit-Specific UIF. Site administrator: Phil Hurvitz. |
Copyright © Phil Hurvitz, 1998-2003 |