Lesson12 - Using ArcView Spatial Analyst
Lesson12 - Using ArcView Spatial Analyst
Lesson12 - Using ArcView Spatial Analyst
Table of Contents
Concepts
Displaying grids
Querying grids
Introduction to map algebra
Getting help
Exercises
Explore online help
Examine the relationship between a grid theme table and grid
cells
Concepts
Classification
Contours and surfaces
Proximity analysis
Overlay analysis
Visualization
Example
Using the ArcView Spatial Analyst: Creating a weighted
distance model
Exercises
Introduction to raster overlay
Introduction to contours and surfaces
Introduction to proximity queries
Lesson summary
Goals
The main component of the ArcView Spatial Analyst is the grid theme, which is the raster
equivalent of the feature theme. ArcView Spatial Analyst allows you to create, query, map, and
analyze cell-based raster data and perform integrated vector-raster analysis.
In this topic, you will learn the basics of displaying and querying grids and of map algebra. You
will also get familiar with the online help
Concept
Displaying grids
Grid themes are symbolized in a Legend Editor just as feature themes are. Grid theme cells are
assigned a solid fill color based on cell value or zone. You can select from several predetermined
classification methods, or you can customize.
To choose an appropriate legend type, you first need to understand what the cell values
contained in your grid theme represent.
Cell values can represent one of two data value types: discrete or continuous.
Discrete data is always stored as an integer grid theme, and its values are codes that represent
the real data value. Discrete data is often--but not always--composed of phenomena whose
boundaries are sharply drawn. Examples of discrete value types are state names, land use types,
soil types, ZIP Codes, road types, and land ownership.
In the case of land use type, for example, the cell value will represent an arbitrary code number
(industrial = 2, agricultural = 3), not a real value.
Discrete grids have Value Attribute Tables (VATs) and can be displayed based on attributes in
the VAT.
Often, but not always, continuous data represents phenomena whose boundaries change more
gradually. Examples of continuous value types are population density, soil acidity (pH), average
income, speed limits, elevation, and the price of land.
In the case of soil acidity, for example, a cell value of 7.6 would represent the real pH value found
in the soil at that spot.
The graphic below shows the continuous data of a grid classified by actual elevation.
Concept
Querying grids
ArcView Spatial Analyst lets you query grid themes using the Map Query dialog. Map Query is
available by selecting Map Query from the Analysis menu or by clicking the Map Query button
.
The Map Query dialog allows you to select areas spatially by defining a Boolean query based on
the values of one or more grid themes. The output will be a new grid theme with areas that match
the query and areas that do not. Those that do match will be given a value of 1 (TRUE); areas
that do not are given a value of 0 (FALSE). If you change the query, it will change the values in
the temporary output grid theme.
The following example shows how to use Map Query to select agricultural land use from a land
use grid.
The following example shows how to use Map Query to locate residential areas within the flood
zone.
Top: A grid of a flood zone displayed over a grid of
landuse. Multiple themes can be compared using the
Map Query dialog. Bottom: The results of the map
query. Areas in red indicate residential areas in the
Landuse theme within the flood zone theme
Concept
Map algebra is a high-level computational language used to perform spatial analysis using grid
(raster) data. Map algebra uses expressions that normally return numeric values to an output
grid. Map algebra expressions are similar to overlay operations, but when comparing layers, map
algebra adds a mathematical or algebraic component.
You do not have to know Avenue to be successful in using these other functions. Knowing some
basic Avenue syntax, however, will be very useful
Concept
Getting help
The ArcView Spatial Analyst Help is found with other online ArcView Help Topics. From the Help
menu, choose Help Topics. Double-click the Extensions book icon, then the Spatial Analyst icon.
Available online Help includes the overview topics listed under the Spatial Analyst book as well as
those under the help topics for associated Avenue classes and requests. By clicking the Help
Index, you can search for any grid help topic.
Help for ArcView Spatial Analyst is available from the
Help menu. Help includes the overview topics that
are listed under the Spatial Analyst book and help for
associated Avenue classes and requests. [Click to
enlarge]
ArcView Help provides a description of every request and type of object, also called a class. The
help topic for each request gives a description of what the request does and what parameters are
required for it to work. It also includes a generic example of how you might use the request. This
syntax example is important because it shows you the type of object (Grid, Number, etc.) that the
request is sent to and the type of objects required for each parameter
Exercise
Note: If you are running ArcView GIS 3.1, you see a Welcome to ArcView GIS dialog.
Click Cancel to close this dialog.
When the ArcView Help opens you see the Contents, Index, and Find tabs. Click the
Contents tab.
You will be performing some of these functions in the next exercise, including adding
and displaying grid themes and examining values in a grid theme table.
Explore topics on your own within the Spatial Analyst book to become more familiar
with using Help.
You can read a little about grids in the Discussion section. Then scroll down to the
section labeled Surface Functions.
As you are scrolling, you will see many requests that can be used on grids. Any green
text is a hypertext link that takes you to another help topic.
In the list of Surface Functions, find the HillShade request and read about it.
You may want to keep help open for the remainder of the exercises in this module.
Exercise
This exercise will also help you start thinking about how
geographic features can be represented with cells rather than
with points, lines, and polygons.
Note: If you are running ArcView GIS 3.1, you see a Welcome to ArcView GIS dialog.
Click Cancel to close this dialog.
Note: If you are running ArcView GIS 3.1, you see an Update l2_ex02.apr
message box. Click No to dismiss this box.
When the project opens, you see a Landuse view without any themes.
Click the Add Theme button to display the Add Theme file browser. In the Data
Source Types dropdown list, choose Grid Data Source. Then, from the basicssa
folder, select the landuse grid and click OK.
Notice that it is classified/symbolized according to cell values. The cell values (1-8)
are not very meaningful, so you will open the theme table and look for a field that
describes the land use codes. The Landuse grid theme has a theme table because it
is an integer grid. It stores only integer values.
With the Landuse theme active, click the Open Theme Table button.
The Landuse_type2 field contains character strings of land use types (e.g.,
Agriculture, Vacant, etc.). This field can be used to better classify the grid theme.
After examining the table, make the view active and open the Legend Editor for the
Landuse theme. Set the Values Field to Landuse_Type2. Apply the changes.
The legend no longer displays the cell values; it now displays the land use
descriptions from the Landuse_type field in the grid theme table.
In the next step, you'll make some selections in the table to see the relationship that
exists between records in the grid theme table and cells in the grid.
With the Attributes of Landuse table active, click the Select Record tool and select
the record that has the Residential Landuse.
Notice that the selected record is highlighted in the table and the corresponding cells
in the view are also highlighted. You can increase or decrease the size of the
selection set by selecting or unselecting more records.
Hold down the Shift key on your keyboard and click on the record with the Agricultural
Landuse.
Selected records in the grid theme table are highlighted, along with the corresponding
cells in the view.
ArcView Spatial Analyst has tools for performing spatial queries, overlay analysis, and surface
analysis.
• Overlay is a GIS operation used to compare two or more themes to reveal new
relationships between features in different themes.
• Distance tools let you analyze the distance between features.
• Contours and surfaces help you analyze an attribute's change over space
Concept
Classification
Classification refers to ordering a theme's data values into a specified number of groups (classes)
according to a particular classification method.
A classification contains a value or a range of values and a label for symbolization. The values
may be either numeric or text. The label is the name associated with the classification.
Themes are classified in ArcView Spatial Analyst using the Legend Editor. Keep in mind that the
classification is for display only. The real values in the classified theme are not changed in any
way. If you want to reclassify themes permanently, you can use the Reclassify option, accessible
from the Analysis menu. Reclassify allows you to change a value, a range of values, or a list of
values of a grid theme to another value in a new grid theme.
Floating point grid themes are divided by default into nine classes, according to their cell values.
The default classification method is Equal Interval; another choice is Standard Deviation. Classes
can be added or deleted and their value ranges changed manually. The display of the No Data
class (which contains all cells that have no data values in them) can be turned on or off.
Integer grid themes, when their legend type is set to Graduated Color rather than Unique Value,
can be classified by any of the five methods available in ArcView: Equal Area, Equal Interval,
Natural Breaks, Quantile, or Standard Deviation
Concept
ArcView Spatial Analyst can create isolines (a line theme) or a continuous surface (a grid theme)
using a theme of sample points. Isolines and surfaces help you analyze continuous change of an
attribute over space (e.g., elevation, temperature, or a soil's pH level).
Isolines are lines on a map connecting defined points of equal Z value. The Z value (x,y, and z) is
an attribute such as elevation, temperature, or rainfall.
Contour lines are isolines of constant elevation with a specified interval and are a common way to
represent terrain. A major drawback of contours is that they indicate surface value only along the
isolines.
Isoline theme created from sample elevation points.
[Click to enlarge]
A surface grid usually contains zones or region polygons. Zones or region polygons consist of two
or more cells with the same value. A zone can consist of cells that are connected or disconnected
or both. Zones whose cells are connected usually represent single features of an area, such as a
building, lake, road, or power line.
Proximity analysis
Proximity analysis refers to analyzing the distance between features to help answer questions like
"How many customers are within 2 miles of each of these stores?" Proximity grids can be used to
determine the area of space allocated to each feature or to find the closest feature in another
theme.
You can use point, line, polygon, and non-null cells when calculating distance. Distances are
calculated from each location (cell) to features in the active theme and stored in a new output
distance grid theme. The continuous distance grid can then be used to create buffers--i.e., zones
of specified distance around a feature.
Overlay analysis
If you want to answer a question like, "Which land use types are inside the flood zone?", you
need to use overlay. Overlay is a GIS operation used to compare two or more themes (layers) to
reveal new relationships between features in the different themes.
Simple overlay analysis (performed using the Summarize Zones option on the Analysis menu)
produces a table and chart of the overlap of features, shapes, or sections of two themes.
Visualization
Visualization refers to the ways in which you can present geographic data so that others can
easily understand it. In GIS, you can accomplish this through visual aids such as topographic and
thematic maps, graphs, and charts.
Grid themes, whether integer or floating point, are symbolized by colors that use a solid fill pattern
and no outline. The colors can be changed, and symbols accessed through the Legend Editor.
A color ramp is an important tool for visualizing spatial data. A color ramp is used with a series of
symbols and begins with one color, ends with another, and distributes the intervening colors of
the spectrum proportionately along the range of symbols. Color ramps are primarily used to
symbolize scalable numeric data, such as elevation, population, or distance from a store.
The following graphic shows a hillshade theme used to enhance the display of an elevation grid
of Redlands, California.
Below is a typical histogram, showing the distribution of the land use values you saw earlier.
Top: A land use grid theme. Bottom: A histogram
created from the land use theme.
Example
A straight line may be the shortest distance as the crow flies, but it's not necessarily the most
desirable route for someone on the ground. It may be a lot cheaper and easier to build a road
around a mountain rather than straight through it.
Finding the best, or least-cost, path is a common problem in spatial analysis. By weighting
distances (that is, incorporating factors such as the cost or difficulty of moving through terrain) it's
possible to build a model of the "best" path between two points.
Steve, a Park Service employee, has been asked to design a bike path between a campground
and scenic overlook. He has several problems to solve to do this. The path can't go through the
lake. He doesn't want to disturb the butterfly habitat. It's more time-consuming and costly to build
through forest than through grassland.
To account for these factors, Steve will create a weighted distance model. He'll reclassify a
terrain grid to assign difficulty values to each kind of terrain. Spatial Analyst will then be able to
calculate the "cost" (measured in units of difficulty) of traveling through each cell in the grid. This
will let him find the best path from the campground to the scenic overlook.
It's easier to build the path on grass, so grass is assigned a value of 1 in the reclassified grid.
Chaparral is more difficult, because more labor is required to clear the land. Chaparral gets a 3"
Forested land gets a 6. As for the butterfly habitat, Steve assigns it a value of 9, meaning that it's
nine times as difficult to travel through a cell of butterfly area as through a cell of grassland.
(The difficulty in this case represents a subjective value, concern for the environment, rather than
an economic cost or a technical challenge.) The lake is reclassified as No Data, which prohibits
Spatial Analyst from putting a path through it. Steve's reclassified theme is called Weighted
Terrain (step 1 of the model diagram).
In the Weighted Terrain grid, the travel cost through
one cell of grass equals the travel cost through three
cells of chaparral, six cells of forest, or nine cells of
butterfly area. (Spatial Analyst prefers a path
through grass to a path through butterfly area until it
becomes nine times as long.) The lake can't be
traveled through. [Click to enlarge]
Now that a difficulty value has been assigned to each cell in the Weighted Terrain grid, Spatial
Analyst can calculate the total cost (cumulative difficulty) of reaching the campground from any
other cell in the grid (step 2 of the diagram). In the Cost grid, each cell's value is the cumulative
travel cost of moving from that cell back to the campground.
Exercise
Note: If you are running ArcView GIS 3.1, you see a Welcome to ArcView GIS dialog.
Click Cancel to close this dialog.
Note: If you are running ArcView GIS 3.1, you see an Update l2_ex03.apr message
box. Click No to dismiss this box.
When the project opens, you see the Flood Zone Analysis view.
The view contains flood zone and land use grid themes. The Landuse theme contains
land use descriptions.
Next, you will compare the two themes by creating a statistical summary table to
report the amount of each land use type inside the flood zone area.
Next, you will be prompted by two message boxes for a theme and a statistic to chart.
A table and chart will be created.
When prompted for the theme containing the variable to summarize, choose the
Flood Zone theme and click OK.
The result of the summary operation is a table of statistical data called Stats of Flood
Zone Within Zones of Landuse. One record in the table represents one land use type
(there should be four records).
Because you selected Sum, a chart called Sum of Flood Zone Within Zones of
Landuse is created.
Examine the chart and table. You see that there are residential areas within the flood
zone. A more detailed analysis is needed to pinpoint the residential locations within
the flood zone area.
In the next step, you will use a map query on the Landuse theme to create a new
theme that contains only residential areas. You will then compare the flood zone and
residential areas. Using another map query, you'll locate the residential areas inside
the flood zone. The results of these operations will be a new theme called Wet
Homes.
[Landuse.Landuse_type2] ="Residential"
Click Evaluate.
The result of the map query is a new theme named Map Query 1. It contains only
residential areas.
Change the name of the new theme from Map Query 1 to Residential, then turn it on.
Turn off the Landuse theme.
Click Evaluate.
The result of the map query is a new theme named Map Query 1. It contains only
residential areas in the flood zone.
Change the name of the Map Query 1 theme to Wet Homes and turn it on. Turn off
the Residential theme.
The Wet Homes theme contains residential areas inside the flood zone. These
parcels could be targeted for flood insurance. City planners could also use this
information to plan for the future.
In this exercise, you will learn how to create contour and surface
themes from a theme of sample points. You'll learn to use both
the Create Contours and Interpolate Surface functions of ArcView
Spatial Analyst.
You will help a farmer balance the pH levels in a field that is being
prepared for the next growing season. Some crops have a better
yield when their soil has a balanced pH level (7). Areas in the field
with a pH of less than seven are treated with lime to raise the pH
level. Areas with a pH level of more than seven are treated with
ammonium sulfate to lower it.
Note: If you are running ArcView GIS 3.1, you see a Welcome to ArcView GIS dialog.
Click Cancel to close this dialog.
Note: If you are running ArcView GIS 3.1, you see an Update l2_ex04.apr message
box. Click No to dismiss this box.
When the project opens, you see the Life on the Farm view. The view contains The
Farm theme and a theme of points called Field Samples.
The Field Samples theme represents soil samples that were collected in the field and
tested for chemical composition. The Field Samples theme table contains several
attributes for chemical levels at each sample point.
In the Surface Grid specifications dialog, set the Output Grid Extent to Same As The
Farm. Click OK.
Setting the Output Grid Extent to Same As The Farm means the new theme will not
extend beyond the farm's rectangle. You could set the output extent equal to the
display, but if you were zoomed out too far, your new theme would be huge,
extending to the edges of the view. It is also important to choose the same extent as
the farm because the sample points are concentrated inside the farm field.
In the Interpolate Surface dialog, choose Spline in the Method dropdown list, and pH
for the Z Value Field. Click OK.
The Z Value field contains the sample pH values that are used to create the contour
lines.
When the processing is finished, enter 0.3 (pH) for the Contour interval in the Contour
Parameters input box. Click OK.
The Contour interval is the distance between the contour lines. The smaller the
Contour interval, the more lines in the new theme.
Lines that are close together indicate quickly changing pH levels. Without labeling, it
is difficult to determine which areas represent high or low concentration. Labeling the
lines, however, may be confusing since some of the lines are very close together.
To better see the areas of high and low concentration, you will create a grid theme of
pH levels using the same sample points.
In the Output Grid Specification dialog, set the Output Grid Extent to Same As The
Farm, then click OK.
In the Interpolate Surface dialog, choose Spline for the Method and choose pH for the
Z Value Field. Click OK and wait a few moments for the surface to be created.
Open the Legend Editor for this theme and click the Reverse Symbol button to
reverse the gray shades of the Surface for Field Samples theme, so the high pH
areas have darker gray shades.
The farmer can use the pH contour line and surface themes to identify treatment
areas. Any pH areas higher than seven may require ammonium sulfate treatment.
Note: If you are running ArcView GIS 3.1, you see a Welcome to ArcView GIS dialog.
Click Cancel to close this dialog.
Note: If you are running ArcView GIS 3.1, you see an Update l2_ex05.apr message
box. Click No to dismiss this box.
When the project opens, you see the Coffee House Locations view with a streets
theme turned on.
Possible sites for new stores should be more than a mile from any existing stores. If
any stores are closer than a mile, they may compete with each other for customers. In
some cases, the distance between stores may be more or less than one mile. For this
study, you will use one mile as the standard.
Move the Distances to Stores theme to the bottom of the Table of Contents and turn it
on. Areas farthest away from existing stores would be good locations for new stores.
When you're finished viewing it, turn off the Distance to Stores theme.
By looking at the display of customers, it is difficult to tell if some of the points are just
really close together or on top of each other; those with the same address may be an
apartment building.
Make the Customers theme active. From the Analysis menu, choose Calculate
Density.
In the Output Grid Specifications dialog, set the Output Grid Extent to Same As
Streets and click OK. In the Calculate Density dialog, keep all the current settings and
click OK.
When the new Density from Customers theme appears, open the Legend Editor for
this theme. Change the Color Ramp to Green monochromatic. Click Apply and close
the Legend Editor.
Move the Density from Customers theme to the bottom of the Table of Contents and
turn it on. Turn off all other themes except Stores.
Examine the display of customer density. The dark green areas have the most
customers.
Ideally, you would want the new store to be located near the customers spending the
most money.
In the next step, you will calculate density again, but this time you will use the
customers' spending patterns. The Customers theme table has a spending field,
which indicates the amount of money that customers spent on their accounts over the
last year.
In the Output Grid Specifications dialog, set the Output Grid Extent to Same as
Streets and click OK. In the Calculate Density dialog, set the Population Field to
Spending and click OK.
Change the name of the Density from Customers theme to Spending Density. Use
the Legend Editor to change this theme's color ramp to Green monochromatic. Click
Apply and close the Legend Editor.
In the Table of Contents, move the Spending Density theme below the Stores theme
and turn it on. Turn off the Density from Customers theme.
Build the following query, where 5280 feet equals 1 mile, and 400 equals the number
of dollars spent by that customer in a year:
Click Evaluate.
When the Map Query 1 theme appears, close the Map Query 1 dialog. Then, change
the name of the Map Query 1 theme to Best Locations. In the Table of Contents,
move the Best locations theme below the Streets theme. Turn on Best Locations and
Streets.
The Best Locations theme displays areas where you might focus efforts to find a new
store location. These are areas more than 1 mile (5280 feet) from an existing store
and which also have the greatest spending density (more than $400 per year).
Before choosing a final location, remember that there are many other factors to
consider: for example, the characteristics of existing store neighborhoods, traffic
counts, proximity to an interstate, income levels, population density, and age.
In this lesson, you learned some basic principles about using ArcView Spatial Analyst. For
example:
Cells in a grid theme are assigned a solid fill color based on cell value or zone. You symbolize
grid themes in the Legend Editor.
A theme's data values are classified with one classification per symbol. Each symbol represents
either a single value or a range of values. Map Algebra is a computational language for
performing spatial analysis on grids. Grid themes can be queried just like feature themes.
Contours and surfaces allow you to analyze continuous change of an attribute over space. You
learned how to create isolines and a continuous surface from a set of sample points. Isolines are
lines connecting points of equal value. A cost surface is a grid defining the friction or cost of
moving through a cell. A cost surface is useful for defining a least-cost path between two
locations.
ArcView Spatial Analyst can perform proximity analysis to analyze the distance between features
or determine the area allocated to each feature. Buffering is a type of proximity analysis; a buffer
is a zone of a specified distance around a feature. ArcView Spatial Analyst can also perform
overlay analysis. You can use overlay analysis to compare two or more themes and determine
where their features overlap.
You learned the importance visualization plays in presenting, understanding, and interpreting
spatial data. Color ramps can be used to symbolize grids as a series of colors and they are
primarily used to symbolize scalable data, such as elevation. Hillshading can be used to visualize
the effects of illumination on a surface, creating a shaded relief grid theme from a surface theme.
In the exercises, you used ArcView Spatial Analyst to perform proximity analysis and overlay
analysis and to create an isoline feature theme and a surface grid theme from sample points
Use the knowledge you have gained in Basics of ArcView Spatial Analyst to answer the following
questions. You will need to correctly answer 7 of the following questions to pass.
Netscape Users: Do not resize this browser window. This can cause the page to reload
and generate new questions.
GOOD LUCK!
1. Expressions can be entered into the Map Calculator in the following format:
Lines that represent a sharp and sudden change in the distribution of surface data
3. A series of symbols that begins with one color, ends with another, and distributes
intervening colors of the spectrum proportionately among the symbols in between is known
as a:
Color range
Color ramp
Color spectrum
Color wheel
4. Only two grid themes can be compared in the Query Builder at any given time.
True
False
5. A cell's color brightness can be varied with values from another grid theme.
True
False
6. Which of the following classification methods can be used on floating point grid themes?
Equal Interval
Equal Area
Quantile
7. You can change the colors used to symbolize a grid theme in the Project Properties dialog.
True
False
8. Use ArcView Spatial Analyst and the L2_ex03.apr project file to answer this question. Which
land use type has the greatest area in the flood zone?
Agriculture
Residential
Vacant
Open space
True
False
10. Map Query creates a new grid theme containing values of 1 and 2.
True
False
Calculate My Grade