Learning Center
Plans & pricing Sign in
Sign Out

Lab 4_ Introduction to ArcGIS Spatial Analyst



This lab introduces raster data model and modeling techniques in ArcGIS Spatial Analyst.

Read Chapter 7 of GIS Concepts and ArcGIS Methods and answer questions in Part I. Continue
with the tutorial exercises in Part II. You should copy any data you download from the course
website onto your flash drive.

As you read through Chapter 7, you should follow along in ArcMap and ArcCatalog. You will be
expected to use the text as reference for Part II – it will emphasize the application of tools
introduced in the text.

Answer the following questions. All labs should be typed, well organized, and stapled together.
You can turn in a hard or electronic copy of your lab.

PART I: Raster Representation & Analysis Settings

   1. How is a raster data model different from vector?
   2. What is a 'band' in the raster data and how does it work?
   3. Why would an integer v. floating point data type make a difference in a raster data set?
   4. What is the difference between a zero (0 or 0.0) and 'no data' value?
   5. Why would you create a pyramids layer for your raster data set?
   6. Briefly describe the 4 raster data types discussed in detail (GRID, Geodatabase, ASCII, &
   7. What are some differences in the symbology tools available for rasters (as opposed to
      vector symbology you have been working with).
   8. Is it important to have datasets & data frame in the same projection during raster
      analysis? Explain why.
   9. What properties or options can you set in the Analysis Environment?

Pages 244 -289 covers a variety of functions available for raster analysis. In this lab, you will be
using a selection of those functions and you will need to use your text as a reference for what
those tools do and how to use them. Obviously, there are many tools available for use, but we
will not have a chance to go through them all.

Pages 293 – 319 covers advanced processing and map algebra. Although you will use some
simple map algebra in this lab, we will not go into extreme detail on this topic. I highly
recommend using your text as a reference and exploring some on your own the tools available
in spatial analyst.

PART II: Cost Surface Analysis

Problem Statement (Adopted from Paul Bolstad, 2009)
Raster analysis is commonly applied when working with continuous data, e.g. elevation, slope, or
distance from features of interest. In this exercise we will calculate an access cost surface based
on raster and vector data layers. This is a simplified example, but introduces basic tools that are
useful in a range of raster analyses. A cost surface analysis uses algorithms to calculate the
cumulative cost of traveling over a digital landscape.

Your cost surface will depend on slope and distance to existing roads. You will assign a road
construction cost of $25 per meter of road required. In the Lab4Data folder you will find a
vector data layer of roads (digitized from USGS maps). You will use grid functions to convert
this to a cost data layer.

Slope also affects access costs, because roads on steeper terrain are more expensive to build.
The cost is nonlinear, increasing slowly at first for low slopes, then more rapidly at steeper
slopes. You will derive slope from a DEM data layer (can be found in Lab4Data folder). You will
also modify the tables associated with both the derived slope and distance layers to include a
cost column. To reflect the nonlinearity in slope costs, you will use the Raster Calculator to apply
a trigonometric sine function to model this increase in cost. Then you will add these two cost
layers. Finally, you will apply an upper threshold of $5,000 to consider only those areas that are
within the budget.

Reclassifying your Data
A Reclassification is a conversion from one set of numbers to another. You can do this with a
raster GIS using the 'reclassify' tool in ArcToolbox. You input the raster file you want to
reclalssify and the old and new values will populate the two columns in the table. Each input
value is matched to an entry in the table and the corresponding output value is reassigned
according to the table. For example, the table below specifies that all Old values between
228.941371 and 229.323492 are assigned a new value of 2.

      Open ArcMap and a new .mxd, add the raster mardem (Lab 4 data folder) to the view,
       and take some time to explore using the Identify tool and the layer properties tab.

   1. What are the units of the elevation (DEM)? What are the highest and lowest
      elevation values? Does it make sense?

Initiating Spatial Analyst
Until program defaults are changed so that this step is unnecessary (which will not be in the
case in the classroom computers), you will have to activate the Spatial Analyst toolbar before
using it. Go to Customize>Extensions and check the Spatial Analyst box. Then add the toolbar
to the main map view (Customize>Toolbars>Spatial Analyst).

      First, you will derive the slope for mardem (pgs 273-74). Open the ArcToolbox window
       and go to the Spatial Analyst toolset. Select Spatial Analyst>Surface Analysis>Slope.
       Specify degrees units for slope. Name the output file mar_slope.

      Examine the slope layer. There should be values from 0 to about 33 degrees.

      Next, you are going to reclassify the data to round (integer) numbers. You will be using
       the Reclassify tool (pgs 248-49 ) found unders Spatial Analyst tools in ArcToolbox. Go to
       'Reclass' and open up the 'Reclassify' tool. A window will pop up with a reclassification
       table, similar to the table in the figure shown previously in the lab.

      Click on the Classify button. This will open a classification window that you are used to
       seeing when changing the symbology with vector data sets. However, in this case you
       are using it to change the assignment or classification table.

      Here, select a Defined Interval classification with an interval width of 1. This means that
       every value will be broken into its own class, converting it into whole numbers.

      Click OK to return to the Reclassify menu. Notice how the reclassification table has
       changed. Now the Old values to New values list should reflect the reclassification you
       specified, as illustrated in the figure below.

Saving the Reclassification Table
Before clicking OK to proceed with the reclassification, you have the option of saving the
reclassification table or loading a saved table (Load & Save buttons right below the
reclassification table). This is useful tool when you have multiple raster datasets that need to be
reclassified using the same classes.

NoData in Reclassifications
You can specify how missing data are assigned by manually entering in a value. Remember that
NoData values are ignored when computing statistics. If you change that, any value you give
will be computed while performing any statistics.

   Specify the name of the output file and optionally the directory of your output file.
    Name the output file Slpcls.

   In order to avoid an error in the classification, you must go to the end of the „old values‟
    in the table and change the last row from 32-33, to 32-34. The maximum number is the
    slope table is over 33, and if this change is not made you will get some wonky results.

   Add slpcls to the map.

   Now remove or shut off the original slope layer.

   Next we will apply a formula that determines the cost of building on slopes. Go to
    Spatial Analyst toolset in ArcToolbox and click on the Raster Calculator tool under 'Map
    Algebra' toolset.

   Type the following function into the center window: Sin(“slpcls”/57.2958) * 200. This is
    the formula that reflects the nonlinearity in slope costs (trigonometric sine function to
    model). The result will be the cost (in dollars) to build using the nonlinear formula

   Enter as shown above, calling the new raster, 'Slope_cost' and click OK. Note that it is
    better to use the calculator buttons than to type the equation using the keyboard –
    generally, you’ll see fewer syntax errors.

   Verify the cost layer makes sense, and that they are highest where slopes are steep.

   Next, we need to display and generate our distance costs from the roads layer (pgs 257-
    65). Add the Mar_rd83.shp (Lab 4 data folder) file.

   Go to the Spatial Analyst toolset in ArcToolbox and find the Euclidean Distance tool in
    the 'Distance' toolset.

   Use the mar_rd83 (roads) dataset as the input since you want to create a raster layer that
    shows the distance from the roads.

   Set the cell size to 30 and store output with a name Distance on your flash drive or in
    your workspace.

   Examine the result layer, and make sure it is reasonable. Are areas with the smallest
    distance closest to the roads, and vice versa?

   Using the Raster Calculator tool, multiply your distance layer by the cost per unit
    distance ($25 per meter) to estimate distance cost.

   Enter the equation as shown in the screenshot below, calling this new layer dist_cost.
    Click OK.

   Our next step is to combine the two sets of costs. Go to the Raster Calculator tool again
    and add the two cost layers, calling the outpus, Total_cost as below:

   Examine the Total_Cost layer and make sure it makes sense.

   Think a minute about what you‟ve just done. You first calculated a slope, and then a cost
    associated with building a road per unit distance across the slope. Then you calculated a
    distance, and then a cost associated with building a road to that distance from an
    existing road. Both of these were calculated for every grid cell in your study area. You
    then added these two together for an estimated total cost to build a road to any portion
    of the mapped area. A more realistic problem would include many other factors, like
    soils, surface vegetation, slope constraints over minimum segments, etc. For the
    purposes of this lab, it would only lengthen the analysis, and not change the basic way
    you are applying the tools.

   Now, for the last criteria of the project – you need to select those areas below the $5,000
    threshold. We will do this by creating a mask grid. This grid will have 1 at all locations
    where the costs are below $5000, and 0 where the costs are above $5,000. We will then
    multiply this with our total cost grid, to zero out those areas we don‟t wish to consider.

   You are going to reclassify the Total_Cost layer. Go to the Reclassify tool in ArcToolbox.
    Enter the Total_Cost layer as the input and click on „Classify‟

   In the reclassification window, set the following parameters to reclassify the Total_cost
    into 2 classes – below $5,000 & above $5,000. Set the number of classes to 2 and then
    manually enter in 5000 in place of the first break value. Leave the 2nd Break Value at the
    current (maximum) level. When you are finished, click OK.

   Call the output of the reclassification, Mask.

   This should result in a reclassification table as shown below. Make sure you have „0‟ for
    the New value of the 5000 to 24753.49024 category. See screenshot below.

   The final step is to multiply the Total Cost raster by the Mask raster. This will „zero‟ out
    all areas that have a cost higher than $5000, and only show those areas within the
    project budget.

   Open the Raster Calculator tool again and multiply Total Cost by Mask, calling the output
    Final_Cost. (see screenshot below)

   Create a map showing the Total_Cost raster, along with the roads layer, mar_83.shp. Add
    a legend (total cost to build roads), titles, name, north arrow, etc. Export as .jpg and
    insert into your lab document.

   Also create a map with three separate data frames on the same layout, to include the
    following: 1) a data frame with the mask layer, 2) a data frame with the slope_costs layer,
    and 3) a data frame with the dist_cost layer.

   Color the mask as gray and white, and color the distance and slopes costs as graduated
    colors, with a gray monochromatic color set. Include the appropriate legend for each
    map, as well as titles, your name, north arrow, etc. Export as .jpg and insert into your
    lab document.


To top