Lab 4: Introduction to ArcGIS Spatial Analyst



1 Lab 4. Raster Analysis

1

2 Introduction

This lab introduces the raster data model, spatial analysis techniques using the ArcGIS Spatial Analyst extension, and basic geocoding techniques in ArcMap.

Raster analysis is commonly applied when working with continuous data, e.g. elevation, slope, for areas of interest. We often have to evaluate and improve the DEM data before we perform our analysis, by fixing, combining, or updating data sets. For this lab, you will first apply a few simple tools to combine two separate DEMs together into a single dataset. Next you will calculate an access cost surface based on raster and vector data layers. These are highly simplified examples, but nevertheless introduce basic tools that are useful for a range of projects.

4 Instructions

Based on the assigned readings for this week, answer questions in Part I of this lab. Then proceed to the next Parts and complete the hands-on exercises. Before working with the lab data, copy it from the course website onto your flash drive.

5 Deliverables

Answer the questions marked in bold and produce the required outputs. Your lab document should be typed, well organized, and submitted according to the course “How To” guidelines.

PART I: Assigned Readings

Textbook – Bolstad, Chapter 2 (pgs. 44-52)

1. How is the raster data model different from the vector data model?

2. Does the value assigned to a raster cell represent all values across the ground covered by the cell area? Why or why not?

3. In a raster attribute table, why is a one-to-one correspondence between cells and attributes rarely used?

4. List three advantages of using a raster data model.

5. List three advantages of using a vector data model.

Textbook – Bolstad, Chapter 9 (sections on “Raster Buffers”, “Raster Overlay”)

6. What two functions are combined to create a raster buffer?

7. In raster overlay, if a cell value in Layer A is “C” and the same cell value in Layer B is “5”, what will the cell value be in the output layer?

Textbook – Bolstad, Chapter 10

8. What is “map algebra”?

9. What is the difference between a zero (0 or 0.0) vs. a “null” value?

10. What is the difference between the “AND” vs. “OR” logical operations?

11. Why are continuous data often converted to categories before being used in raster overlay?

12. How does a “binary mask” work?

13. Why is a neighborhood function “moving window” typically odd-numbered in both the x and y directions?

ESRI ArcGIS 10 Online Help Files

14. What is a “band” in raster data, and how does it work?

15. For raster data, what is a “zone” vs. a “region”?

16. Where do you find out basic information about a raster dataset?

17. Why would you create a “pyramid” layer for your raster data set?

18. For each of the following resampling types, how many input cells are used to determine the output raster cell value: nearest neighbor, bilinear interpolation, cubic convolution?

PART II: Updating DEM Data

Problem Statement (Adapted from Paul Bolstad, 2012)

DEM datasets are often available in differing resolutions (cell sizes), and for different parts of our study area, than what we might prefer. For example, DEMs at approximately 10 m resolution have been developed for nearly all of the lower 48 US states. Higher resolution DEMs (typically 1 to 3 m) are currently under production for many, but not all, portions of the US. We may find part of our study area in each of these zones.

We can use raster functions to improve our DEM data. For this exercise, you will mosaic DEM data having two different resolutions using various tools provided by the ArcGIS Spatial Analyst extension. First, you will combine two DEMs: valley3 (at a 3-meter resolution) and valley9 (at a 9-meter resolution). We want to use the higher resolution data where we have it, but use the lower resolution data for the rest of the study area.

Preparing for analysis

Step 1. Set Geoprocessing Environments

• Set a current workspace

• Set the output coordinate system

Step 2. Sketch your Workflow

• Read trough the Update DEM Data project and create a sketch workflow

Analysis

• Start ArcMap and add both the valley3 and valley9 data sets to the map view. Your view should be similar to that shown below.

[pic]

First, you will derive a hillshade for each dataset using the Spatial Analyst Hillshade tool. Before using the tool, make sure that the Spatial Analyst extension has been activated.

Activating the Spatial Analyst extension

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 extension in order to access the Spatial Analyst tools. Go to Customize > Extensions and check the Spatial Analyst box. Then add the toolbar to the main map view (Customize > Toolbars > Spatial Analyst).

• Open the ArcToolbox window and go to the Spatial Analyst toolbox. Select Surface > Hillshade.

[pic]

• Select valley3 for the Input raster, name the Output raster vall3hillshd, and click OK to run the tool. Repeat these steps for the valley9 dataset and create the Output raster vall9hillshd.

• Inspect your two resulting hillshades carefully (see example below). The figure on the left shows the valley3 hillshade, and the valley9 hillshade is on the right. Note the enhanced detail with the 3-meter DEM, such as the greater definition of the small streams and their streambanks.

[pic][pic]

valley3 hillshade valley9 hillshade

You will combine these two datasets in such a way that the detailed valley3 data is used where available, and the coarser valley9 data is used everywhere else. To avoid confusing results, you will need to combine raster datasets that have the same resolution. Therefore, your first step will be to convert the 9-meter data into a 3-meter cell size. (Note that this does not make the 9-meter data more accurate - instead, you will be just making a copy of the data at a finer resolution.)

To convert the dataset cell size, you will use the raster processing Resample tool.

• Open ArcToolbox and go to the “Data Management Tools” toolbox. Select Raster > Raster Processing > Resample.

[pic]

• In the Resample window, select valley9 as the Input raster, name the Output Raster valley9to3, and specify an Output Cell Size of “3”, and a Resampling Technique of “BILINEAR”. Click OK to run the tool.

1. What is bilinear resampling?

• After the resampling is complete, examine the valley9to3 dataset and verify that it has a 3-meter resolution (Layer Properties > Source tab).

Now let’s combine the two datasets using the Spatial Analyst Raster Calculator tool. Although there are many ways to do this, perhaps one of the simplest is with the clever use of two raster functions – IsNull and Con. The IsNull function returns “True” whenever a cell comparison or value is Null. The Con function takes three values, the first is a true/false test, and second is the value to assign to a grid if the test is true, and the second is the value to assign if the test is false.

• In ArcToolbox, go to the Spatial Analyst toolbox. Select Map Algebra > Raster Calculator.

[pic]

• Type the following function into the center window. (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.)

Con(IsNull("valley3"),"valley9to3","valley3")

• This formula checks to see whether or not a cell is within the extent of the valley3 dataset (using the IsNull function). If it is outside of the extent, it is assigned a value (using the Con function) from the valley9to3 dataset; otherwise it is assigned a value from the valley3 dataset. The result will be a single output dataset containing the highest possible resolution value for each cell.

• Name the Output raster combineDEM, and click OK to run the tool.

• Examine the combineDEM raster dataset. Use the Hillshade tool to create a hillshade for it, and verify that it contains higher detail for the cells covered by the valley3 dataset.

• Create a map at a 1:20,000 map scale that includes the combineDEM hillshade showing an area of overlap between the valley3 and valley9to3 dataset extents. Include the necessary map elements.

2. Insert your map to your lab document as a jpg.

3. Create a workflow diagram for your Updating DEM Data project and insert into your lab document.

4. Are there any of the Raster Geoprocessing Environments that you could have set to make this project more seamless?

PART III: Cost Surface Analysis

Problem Statement (Adapted from Paul Bolstad, 2012)

Raster analysis is commonly applied when working with continuous (raster) data, e.g. elevation, slope, or distance from features of interest. In this exercise, you will work with both raster and vector datasets to analyze the cost of building new roads across a landscape (surface). This type of analysis is known as cost surface analysis, as it uses algorithms to calculate the cumulative cost of traveling over a digital landscape.

You will create what is known as an access cost surface, i.e. a surface representing how the cost of building a new road changes as you access different locations across the surface. For the purpose of this lab, cumulative cost will be measured in US dollars. The road construction cost is $25 per meter. Slope 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. Distance affects access costs because the farther out from existing roads you build a new road, the higher the total cost.

You will create two cost layers, one for slope and one for distance. The slope cost layer will be derived from a DEM dataset. To reflect the nonlinearity in slope costs, you will use the “Raster Calculator” tool to apply a trigonometric sine function to model the change in cost as slope changes. The distance cost layer will be derived from a vector roads dataset. Using Grid functions, you will convert the roads features into a cost layer that represents distance from roads. Finally, you will combine the two cost layers together. You will assign a road construction cost of $25/meter, and apply an upper threshold of $5,000 to consider only those areas that are within the budget.

Preparing for analysis

Step 1. Set Geoprocessing Environments

• Set a current workspace

• Set the output coordinate system

Step 2. Sketch your Workflow

• Read trough the Cost Surface Analysis project and create a sketch workflow

Analysis

• Open ArcMap and create a blank .MXD, add the raster mar_dem to the view. Take some time to explore the mar_dem dataset using the Identify tool and the Layer Properties tab.

[pic]

1. What are the units of the elevation (DEM)? What are the highest and lowest elevation values? Do these values make sense, and why or why not?

First, you will derive the slope for mar_dem using the Spatial Analyst Slope tool.

• Open the ArcToolbox window and go to the Spatial Analyst toolbox. Select Surface > Slope.

[pic]

• In the Slope window, select mar_dem as the Input raster and name the Output raster mar_slope. Specify degrees for the output slope units (set Output Measurement to “DEGREE”). Click OK to run the tool.

• Examine the resultant mar_slope layer – it should contain values from 0 to about 33 degrees.

Next, you are going to convert the slope values from floating point format (decimals) to integer format (round numbers). You will be using the Spatial Analyst Reclassify tool.

Reclassifying your Data

A reclassification is a conversion from one set of numbers to another. You input the raster file you want to reclassify, 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.

• In ArcToolbox, go to the Spatial Analyst toolbox. Select Reclass > Reclassify. The “Reclassify” window will open, containing a Reclassification table (similar to the one shown below).

[pic]

• Select mar_slope as the Input raster, then click on the “Classify…” button. This will open a classification window that you have seen when changing the symbology for vector data sets. However, in this case you are using it to change the assignment or classification table.

[pic]

• Select a Defined Interval classification with an interval width (size) 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 window. Notice how the Reclassification table has changed. Now the “Old values” and “New values” lists should reflect the reclassification you specified, as illustrated in the figure below.

[pic]

• Specify your output raster file path, and name the output raster slp_cls. Click OK to run the Reclassify tool, and add the resultant slp_cls to the map.

Reclassification Table – Additional Options (for future reference)

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

NoData in Reclassifications: At the end of the Reclassification table, 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.

Next you are going to apply a formula that determines the cost of building on slopes. To do this, you will use the Spatial Analyst Raster Calculator tool.

• In ArcToolbox, go to the Spatial Analyst toolbox. Select Map Algebra > Raster Calculator.

• In the Raster Calculator window, type the following expression into the center window:

Sin(“slp_cls” / 57.2958) * 200

• This is the formula that reflects the nonlinearity in slope costs (modeled using a trigonometric sine function). The result will be the road construction cost (in dollars). 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.

[pic]

• Specify your output raster file path, and name the output raster slp_cost. Click OK to run the Raster Calculator tool.

• Verify that the cost layer makes sense, i.e. costs are higher where slopes are steeper. Also, notice how color is used to symbolize the data values.

2. How does the color ramp symbolizing the low-to-high cost range differ cartographically from color ramps used in previous labs?

Next, you need to estimate cost distance values by first generating a raster layer showing the straight-line (Euclidean) distance from roads, and then multiplying your distance layer by a cost per unit distance. You will be using the Spatial Analyst Euclidean Distance tool.

• Add the roads vector layer (mar_roads.shp) to your map view.

• In ArcToolbox, go to the Spatial Analyst toolbox. Select Distance > Euclidean Distance.

• Select mar_roads as the Input feature dataset, since you want to create a raster layer that shows the distance from the roads line features.

• Specify your output directory, name the output file distance, and set the cell size to “30”. Click OK to run the tool.

[pic]

• Examine the resulting layer to make sure the values seem reasonable – i.e. are areas with the smallest distance closest to the roads, and vice versa?

Now use the Raster Calculator tool to estimate the distance cost, i.e. the cost of building closer vs. farther away from existing roads.

• In ArcToolbox, go to the Spatial Analyst toolbox. Select Map Algebra > Raster Calculator.

• In the Raster Calculator window, multiply your distance layer by the cost per unit distance ($25 per meter) to estimate distance cost. Enter the following expression:

“distance” * 25

[pic]

• Name the output layer dist_cost. Click OK to run the tool.

Our next step is to combine the two sets of costs, again using the Raster Calculator tool.

• Open the Raster Calculator tool. Enter the following expression to combine the two cost layers together:

“slp_cost” + “dist_cost”

[pic]

• Name the output layer total_cost. Click OK to run the tool. Examine the total_cost layer and make sure that the values make sense.

Think a minute about what you’ve just done. You first calculated a slope, and then a cost associated with building a new road per unit distance across the slope. Then you calculated distance from existing roads, and a cost associated with building a new road to the calculated distances from existing roads. Both types of costs were calculated for every grid cell in your study area. You then added the two cost types 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. However, for the purpose of this lab, including additional factors would only lengthen the analysis - it would 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 the value of “1” for all locations that we would like to keep (i.e. where the costs are below $5,000), and the value of “0” for the locations that should be excluded from appearing in the output dataset (i.e. where the costs are above $5,000). We will then multiply this with our Total Cost grid, in order to literally “zero out” those areas that we don’t wish to consider.

First, you are going to reclassify the total_cost layer.

• Open the ArcToolbox Reclassify tool, select the total_cost layer as the Input raster, then click on the “Classify” button.

• In the Classification window, define the following parameters to group the total_cost values into 2 classes (below $5,000 and above $5,000)… Set the number of classes to “2”, then in the “Break Values” column manually enter “5000” in place of the first break value. Leave the second Break Value at the current (maximum) level. (Note that when you type in the first break value, the Classification Method automatically switches to “Manual”.)

• Click OK when finished to apply the changes and close the Classification window.

• This should result in a Reclassification table as shown below. Make sure you have “0” (zero) for the New value of the 5000 to 24753.49024 category.

[pic]

• Name the output of the reclassification operation mask, and click OK to run the tool. Examine the mask layer and make sure that the values make sense.

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, naming the output final_cost. (see screenshot below)

[pic]

• Click OK to run the tool. Examine the final_cost layer and make sure that the values make sense.

Create four maps in order to illustrate your work. Each map may be included separately in your lab document, or you may combine them into one or more map layouts. Include the appropriate legend for each map, as well as titles, your name, north arrow, etc. Where appropriate, indicate that cost values are represented in US dollars.

• Map #1: show the final_cost raster along with the roads layer, mar_roads.shp. Use a graduated color ramp of your choice for the final_cost layer. You may find that all of the “outside of budget” areas are the same color as the “low cost” areas, which can be confusing. Try this to reduce confusion… make a copy of the mask layer and situate it in the Table of Contents so that it draws above the final_cost layer. Think of the copied mask layer as a “cartographic mask”. In the cartographic mask layer, set the “0” (zero) values to have a neutral background color (to block off the “outside of budget” areas) and the “1” values to have no color (i.e. transparent so that the final_cost values can show through). Be sure to include your mask layer in your legend, and label it as containing “outside of budget” areas.

• Map #2: show the mask layer, using dark gray and white colors.

• Map #3: show the slp_cost layer, using a graduated gray color ramp.

• Map #4: show the dist_cost layer, using a graduated gray color ramp.

4. Export your maps in JPEG format and insert into your lab document.

5. Create a workflow diagram for your Cost Surface Analysis project and insert into your lab document.

6. Are there any of the Raster Geoprocessing Environments that you could have set to make this project more seamless?

-----------------------

[pic]

[pic]

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download