Spatial Analyst Raster Data Analysis and DEMs v2
Spatial Analyst Raster Data Analysis and DEMs v2
Using ArcMap in ArcGIS, we will determine the probable nesting locations of the rare
marbled murrelet (Brachyramphus marmoratus) in the Navarro River watershed. The
marbled murrelet is a secretive bird, but it is thought to make its nests in old growth
forests on steep ( > 20 degrees), west-facing slopes within 35 km of the ocean at or
around the 150m elevation.
This type of analysis is a common one, called a suitability analysis. It is used to help us
answer the question of what locations meet a set of conditions.
Review
1. Start ArcMap
Hint: From the start menu, you can also just search for your programs by typing the name in the search
box at the bottom
A Suitability Analysis: Spatial Analyst, Raster Data, and DEMs - Coursera Specialization in Geographic Page 1
Information Systems. Copyright 2016 Regents of the University of California
A Suitability Analysis: Spatial Analyst, Raster
Data, and DEMs
A Suitability Analysis: Spatial Analyst, Raster Data, and DEMs - Coursera Specialization in Geographic Page 2
Information Systems. Copyright 2016 Regents of the University of California
A Suitability Analysis: Spatial Analyst, Raster
Data, and DEMs
Create a new, blank map using the Getting Started box that will pop up automatically.
1. Select New Maps from the lefthand bar to see templates for new maps
2. Select Blank Map in the main window
3. Double check (or at least be aware of) your default geodatabase. No need to change it for now
4. Click OK
First things first, let's save your empty map. Save it either by hitting Ctrl+S or going to the File menu and
clicking on Save. You'll see a familiar box pop up.
A Suitability Analysis: Spatial Analyst, Raster Data, and DEMs - Coursera Specialization in Geographic Page 3
Information Systems. Copyright 2016 Regents of the University of California
A Suitability Analysis: Spatial Analyst, Raster
Data, and DEMs
Navigate to the mxds folder inside your Labs folder and save this document as suitability.mxd
A Suitability Analysis: Spatial Analyst, Raster Data, and DEMs - Coursera Specialization in Geographic Page 4
Information Systems. Copyright 2016 Regents of the University of California
A Suitability Analysis: Spatial Analyst, Raster
Data, and DEMs
I like to view California data in the NAD 1983 California Teale Albers projection - it's centered on
California, so distortion is minimized. The problem, for this lab, is that we'll be using some rasters that
came in other projections - and projecting rasters is difficult and should usually be avoided. So, instead
of projecting the raster, let's just view it differently by setting the projection on our data frame.
A Suitability Analysis: Spatial Analyst, Raster Data, and DEMs - Coursera Specialization in Geographic Page 5
Information Systems. Copyright 2016 Regents of the University of California
A Suitability Analysis: Spatial Analyst, Raster
Data, and DEMs
4. 7 coordinate systems will come up - select NAD 1983 California (Teale) Albers (Meters)
5. Click OK
6. Save your document again
A Suitability Analysis: Spatial Analyst, Raster Data, and DEMs - Coursera Specialization in Geographic Page 6
Information Systems. Copyright 2016 Regents of the University of California
A Suitability Analysis: Spatial Analyst, Raster
Data, and DEMs
Let's start by making sure Spatial Analyst is enabled. Spatial Analyst is a very powerful ArcGIS tool for
raster processing, making it essential for working with DEMs. It has a built in hydrology toolset that
forms the basis for stream generatiojn from a DEM. It is not enabled by default though, so we'll need to
go through a few steps to enable it. Add the Spatial Analyst Extension by:
A Suitability Analysis: Spatial Analyst, Raster Data, and DEMs - Coursera Specialization in Geographic Page 7
Information Systems. Copyright 2016 Regents of the University of California
A Suitability Analysis: Spatial Analyst, Raster
Data, and DEMs
A Suitability Analysis: Spatial Analyst, Raster Data, and DEMs - Coursera Specialization in Geographic Page 8
Information Systems. Copyright 2016 Regents of the University of California
A Suitability Analysis: Spatial Analyst, Raster
Data, and DEMs
You can see all of the Spatial Analyst tools in the toolbox.
Add the Navarro River DEM from your data folder. It's located inside the geodatabase for this
assignment and named nav_dem_10m. If it's been a while since you've worked in ArcGIS, see the
screenshots below for whereto click
A Suitability Analysis: Spatial Analyst, Raster Data, and DEMs - Coursera Specialization in Geographic Page 9
Information Systems. Copyright 2016 Regents of the University of California
A Suitability Analysis: Spatial Analyst, Raster
Data, and DEMs
4. Click Add
When adding data, note the icon differences – can you tell the difference between the data types?
A Suitability Analysis: Spatial Analyst, Raster Data, and DEMs - Coursera Specialization in Geographic Page 10
Information Systems. Copyright 2016 Regents of the University of California
A Suitability Analysis: Spatial Analyst, Raster
Data, and DEMs
A Suitability Analysis: Spatial Analyst, Raster Data, and DEMs - Coursera Specialization in Geographic Page 11
Information Systems. Copyright 2016 Regents of the University of California
A Suitability Analysis: Spatial Analyst, Raster
Data, and DEMs
Take a look at the information available to you on the Source tab - number of rows and columns, bands,
the cell size. What else? Scroll through the properties box and take a look at the full palette.
A Suitability Analysis: Spatial Analyst, Raster Data, and DEMs - Coursera Specialization in Geographic Page 12
Information Systems. Copyright 2016 Regents of the University of California
A Suitability Analysis: Spatial Analyst, Raster
Data, and DEMs
A Suitability Analysis: Spatial Analyst, Raster Data, and DEMs - Coursera Specialization in Geographic Page 13
Information Systems. Copyright 2016 Regents of the University of California
A Suitability Analysis: Spatial Analyst, Raster
Data, and DEMs
First, what's happening with the colors - are they matching to reality (in a color for color sense and in an
elevation sense)?
1. There is an alternate way of getting to the Data Layer Properties Form. What is it?
2. There is an alternate way of changing the Data Layer Legend ramp colors. Can you find it?
3. What about a quick rename of the Data Layer?
4. How do you turn all of the layers 'off' (so they aren't visible anymore) ?
A Suitability Analysis: Spatial Analyst, Raster Data, and DEMs - Coursera Specialization in Geographic Page 14
Information Systems. Copyright 2016 Regents of the University of California
A Suitability Analysis: Spatial Analyst, Raster
Data, and DEMs
1. Click the histogram button on the Spatial Analyst toolbar after making sure that your navarro
DEM is selected.
Again, does your histogram match what you expect to see based on the layer's display in the map
viewer? What is it telling you? Note the large number of values (hard to see) in a single bar on the far
right of the graph!
Where would the mean value and standard deviations fall? Is this DEM normally distributed? Will this
affect your analyses?
A Suitability Analysis: Spatial Analyst, Raster Data, and DEMs - Coursera Specialization in Geographic Page 15
Information Systems. Copyright 2016 Regents of the University of California
A Suitability Analysis: Spatial Analyst, Raster
Data, and DEMs
If you right click on the graphic, the dropdown menu offers Properties and Advanced Properties. Open
up each of those in turn and see what they have to offer and what changes and options you can make
on your graphic - can you find where you can change the scale of the graphic and the maximum
values?
A Suitability Analysis: Spatial Analyst, Raster Data, and DEMs - Coursera Specialization in Geographic Page 16
Information Systems. Copyright 2016 Regents of the University of California
A Suitability Analysis: Spatial Analyst, Raster
Data, and DEMs
You can also see a histogram with other properties by looking at the symbology when using the
Classified renderer. Open up the symbology palette
ArcGIS will show you what it's using to determine the elevation classes - and you can change those
options from this palette there too. Take a look around and try playing with the settings here a bit,
thinking about potential other uses for these options. When you are done, cancel out of these boxes,
leaving the classification alone.
A Suitability Analysis: Spatial Analyst, Raster Data, and DEMs - Coursera Specialization in Geographic Page 17
Information Systems. Copyright 2016 Regents of the University of California
A Suitability Analysis: Spatial Analyst, Raster
Data, and DEMs
6. Analysis Setup
To begin our analysis, we'll need to set up our Geoprocessing Environments (recall what those are).
Environment Variables (or simply "Environments" as they are often called) help us maintain consistency
and formats in the analysis and output and provide us with data management options. We can set them
A Suitability Analysis: Spatial Analyst, Raster Data, and DEMs - Coursera Specialization in Geographic Page 18
Information Systems. Copyright 2016 Regents of the University of California
A Suitability Analysis: Spatial Analyst, Raster
Data, and DEMs
in two places, in a specific geoprocessing tool, or for an entire ArcMap document, where they will be
used for all geoprocessing tools that they apply to - we will do that now.
6.1
1. The Environment Settings window will pop up, we're going to set Output coordinates to be the
same as nav_dem_10m (not shown in picture, but marked by icon 1)
2. Set the Extent to be Same as layer nav_dem_10m
3. Set the snap raster to nav_dem_10m (what do you think this does?)
4. Set the cell size to be Same as layer nav_dem_10m
5. and finally, set the Mask to nav_dem_10m (what does this do?)
What other environment settings might you set? Look around at what's available to get a sense for them
for when you need them. Note also that ArcGIS help specifies for each tool the environment settings
that affect them.
A Suitability Analysis: Spatial Analyst, Raster Data, and DEMs - Coursera Specialization in Geographic Page 19
Information Systems. Copyright 2016 Regents of the University of California
A Suitability Analysis: Spatial Analyst, Raster
Data, and DEMs
Finally, note that when you set the values for the environment settings, some of them may appear to not
stay set. That usually means it has read in the information from the layer, and set the values for the
extent below (as in the Extent setting).
A Suitability Analysis: Spatial Analyst, Raster Data, and DEMs - Coursera Specialization in Geographic Page 20
Information Systems. Copyright 2016 Regents of the University of California
A Suitability Analysis: Spatial Analyst, Raster
Data, and DEMs
Recall that the marbled murrelet creates its nests on steep terrain ( > 20 degrees) - so we'll need to
incorporate that into our analysis. To begin this process, we'll make a slope raster from our output
raster. Conceptually, if you know the elevations of each location, you can determine the slope to
neighboring locations - that's what this geoprocessing tool does.
Locate the Slope tool either by using the Search panel, or by finding it under Spatial Analyst Tools >
Surface > Slope. We'll use our DEM as our input raster - save the output raster somewhere reasonable
that you can find it later. For the Output measurement, what option should we select? Check the
problem statement to determine what to use.
Once the slope raster is generated, Change the Legend Value Classification to Standard Deviation type
on the symbology palette. Then, examine the slope of the Navarro DEM. Does it seem representative of
a coastal watershed?
What is the distribution of Degree Slope in the Watershed? Select your slope layer on the Spatial
Analyst toolbar and click the Histogram button (1).
A Suitability Analysis: Spatial Analyst, Raster Data, and DEMs - Coursera Specialization in Geographic Page 21
Information Systems. Copyright 2016 Regents of the University of California
A Suitability Analysis: Spatial Analyst, Raster
Data, and DEMs
7.2
A Suitability Analysis: Spatial Analyst, Raster Data, and DEMs - Coursera Specialization in Geographic Page 22
Information Systems. Copyright 2016 Regents of the University of California
A Suitability Analysis: Spatial Analyst, Raster
Data, and DEMs
Generate a raster grid representing aspect (remember what aspect is?) by selecting the Aspect tool
from the Spatial Analyst toolbox (Spatial Analyst > Surface > Aspect). What do you think the input raster
should be? See the screenshot below for a hint.
A Suitability Analysis: Spatial Analyst, Raster Data, and DEMs - Coursera Specialization in Geographic Page 23
Information Systems. Copyright 2016 Regents of the University of California
A Suitability Analysis: Spatial Analyst, Raster
Data, and DEMs
Once it's generated, Examine the Legend associated with Aspect of Navarro DEM. What are the values
depicting?
What value is used for flat areas? Is there anything peculiar about the output? Make flat areas black
and examine the output up close.
8.2
Examine the distribution of the ASPECT raster data (choose either method - spatial analyst or the layer
symbology properties. Symbology properties are shown below):
A Suitability Analysis: Spatial Analyst, Raster Data, and DEMs - Coursera Specialization in Geographic Page 24
Information Systems. Copyright 2016 Regents of the University of California
A Suitability Analysis: Spatial Analyst, Raster
Data, and DEMs
A Suitability Analysis: Spatial Analyst, Raster Data, and DEMs - Coursera Specialization in Geographic Page 25
Information Systems. Copyright 2016 Regents of the University of California
A Suitability Analysis: Spatial Analyst, Raster
Data, and DEMs
Generate a grid representing HILLSHADE by selecting the Hillshade tool in the Spatial Analyst toolbox
Use the built in Geoprocessing Tool Help to determine what the Azimuth and Altitude input parameters
are used for and why you might want to change them.
Accept the default parameters of Azimuth = 315 and Altitude = 45 and select OK.
A Suitability Analysis: Spatial Analyst, Raster Data, and DEMs - Coursera Specialization in Geographic Page 26
Information Systems. Copyright 2016 Regents of the University of California
A Suitability Analysis: Spatial Analyst, Raster
Data, and DEMs
9.1
The default hillshade is ok, but let's visualize it a little better in a quick way. Set the transparency of
nav_dem_10m to 40% (in layer Properties->Display) and move it above the nav_hillshade_10m raster
grid. Notice the draping effect? This is 2/3 of a “Swiss Hillshade,” which combines a hillshade layer, a
DEM, and an "aerial perspective" layer to create a more natural hillshade.
A Suitability Analysis: Spatial Analyst, Raster Data, and DEMs - Coursera Specialization in Geographic Page 27
Information Systems. Copyright 2016 Regents of the University of California
A Suitability Analysis: Spatial Analyst, Raster
Data, and DEMs
Let's just take a quick look at how this new version of the hillshade compares to the plain ArcMap
version. To do this, we'll bring up the Image Analysis window (under the Windows menu in ArcMap).
Let's use the Swipe Layer tool to compare the images. Then:
A Suitability Analysis: Spatial Analyst, Raster Data, and DEMs - Coursera Specialization in Geographic Page 28
Information Systems. Copyright 2016 Regents of the University of California
A Suitability Analysis: Spatial Analyst, Raster
Data, and DEMs
Add the nav_estuary feature class to your map document (located in your geodatabase for this
assignment, Spatial_Analyst_Assignment.gdb).
1. Zoom in on the Estuary. Make sure that on the Spatial Analyst toolbar, the nav_dem_10m is
selected. Then, select the Contour Tool (it looks like a thumbprint) from the Spatial Analyst
Toolbar.
2. Use the tool to draw a contour around the Estuary by clicking on the View Frame once at the
edge of the Estuary Polygon. What happens when you do this? Zoom out a step or two. What
do you think is going on? Do these contours behave like contours you're more familiar with?
This can be done for as many elements that the DEM attributes and structure can support, but it could
be very laborious to do the entire watershed. Further, note that these are graphic elements and can be
edited as such, they are not layers. This means that from a data standpoint, they're no longer
meaningful, except to a human who can interpret them. To delete the contours, you can use your Select
Elements tool (the normal pointer on the toolbar next to the Identify tool), then once they are highlighted
(with the dashed line box around them), you can hit the delete key to delete the element.
A Suitability Analysis: Spatial Analyst, Raster Data, and DEMs - Coursera Specialization in Geographic Page 29
Information Systems. Copyright 2016 Regents of the University of California
A Suitability Analysis: Spatial Analyst, Raster
Data, and DEMs
A Suitability Analysis: Spatial Analyst, Raster Data, and DEMs - Coursera Specialization in Geographic Page 30
Information Systems. Copyright 2016 Regents of the University of California
A Suitability Analysis: Spatial Analyst, Raster
Data, and DEMs
So, let's create contours "the right way" now - in a way that preserves the geography of the data and
gives us a true feature class as its outut. Open the Contour tool (Spatial Analyst Tools > Surface >
Contour). Think for a moment about what your input to this tool will be, just as a matter of practice.
Yup, it's your DEM - Put the output in a sensible location and set the Contour interval to 100m (this
parameter is really up to you, but if you want consistent results, set it to 100). Set the Base contour to 0
(we are operating at sea level after all).
When it's done, right click on your resulting contours layer in the table of contents and select Zoom to
Layer to get an overview of the results.
A Suitability Analysis: Spatial Analyst, Raster Data, and DEMs - Coursera Specialization in Geographic Page 31
Information Systems. Copyright 2016 Regents of the University of California
A Suitability Analysis: Spatial Analyst, Raster
Data, and DEMs
A Suitability Analysis: Spatial Analyst, Raster Data, and DEMs - Coursera Specialization in Geographic Page 32
Information Systems. Copyright 2016 Regents of the University of California
A Suitability Analysis: Spatial Analyst, Raster
Data, and DEMs
We have most of the information we need at this point - our DEM, slope, and aspect grids - but we still
need to know where the old growth forests are, and the distance from the coast. For these two items,
we'll load them from our data geodatabase (Spatial_Analyst_Assignment.gdb/nav_oldgrowth and
Spatial_Analyst_Assignment.gdb/nav_coast_distance).
Once we have loaded that data, we can begin processing our data for suitable habitat.
Now, we need a way to pull the locations from our slope raster that meet our slope conditions of being
greater than 20 degrees slope. Start by opening the Raster Calculator geoprocessing tool (find it via
search, or under Spatial Analyst Tools > Map Algebra > Raster Calculator).
A Suitability Analysis: Spatial Analyst, Raster Data, and DEMs - Coursera Specialization in Geographic Page 33
Information Systems. Copyright 2016 Regents of the University of California
A Suitability Analysis: Spatial Analyst, Raster
Data, and DEMs
This tool works a lot like Select by Attributes on a vector dataset - we need to construct a query, against
the raster's cell values (or multiple rasters' values), that identifies cells that we are interested in. It then
creates an output layer with just those cells (and everything else is Null). Think for a moment about
what your query might be.
In this case, if you're storing your rasters in a geodatabase, your query should be something like
"nav_slope_10m" > 20 - but let's construct it together.
1. Double click on nav_slope_10m in the Layers and variables box to add it to the query box
(directly below it). Double clicking it here takes care of any necessary quoting based upon the
workspace the rasters are stored in (geodatabase, folder, etc).
2. Click the greater than symbol (>) in the set of buttons to add it to the query experession box.
3. Click into the query expression box and add 20 to the end of the expression so that it matches
the image below. What is this expression saying now?
4. Save your output raster somewhere useful. I left mine in my default geodatabase since it's an
intermediate product and named it nav_habslope_gt20
A Suitability Analysis: Spatial Analyst, Raster Data, and DEMs - Coursera Specialization in Geographic Page 34
Information Systems. Copyright 2016 Regents of the University of California
A Suitability Analysis: Spatial Analyst, Raster
Data, and DEMs
You should see something similar to the below as a result (your colors may be different). Take a look at
the legend entries for this raster - what do you think they mean? Why do the numbers come out as 0
and 1?
In computer science in general, 0 and 1 tend to represent "false" and "true" respectively, or "no" and
"yes". If we think of the expression we put into raster calculator as a question "Is the slope greater than
20 degrees?" then the values in the raster are answering that question as "yes" (1) and "no" (0) for each
location.
Let's now create the equivalent analysis grids for aspect, elevation, and coast distance. For each of
these, we'll run raster calculator again - think about what your expressions will be.
(1) Aspect Expression: (“nav_aspect_10m" > 225) & ("nav_aspect_10m" < 315)
Your expression will vary if you didn't store your rasters in a file geodatabase. To get the correct
expression, you can double click the layer nav_aspect_10m in the layer list instead of typing it in. It will
A Suitability Analysis: Spatial Analyst, Raster Data, and DEMs - Coursera Specialization in Geographic Page 35
Information Systems. Copyright 2016 Regents of the University of California
A Suitability Analysis: Spatial Analyst, Raster
Data, and DEMs
then surround it in the correct delimiters (quotes). Make sure to include the parenthesis in this case.
What is that expression saying?
(2) Elevation Expression: ("nav_dem_10m" > 50) & ("nav_dem_10m" < 250)
Why is coastdist <= 35? Should it be <= 35,000 instead? Look at the legend for nav_coast_distance to
understand what value to use better.Do we need to do anything with the Old Growth Raster?
A Suitability Analysis: Spatial Analyst, Raster Data, and DEMs - Coursera Specialization in Geographic Page 36
Information Systems. Copyright 2016 Regents of the University of California
A Suitability Analysis: Spatial Analyst, Raster
Data, and DEMs
Ok, now we have separate rasters for suitability, based on each parameter. We need to combine them
into a single raster indicating overall suitability for the species. If each raster habitat suitability raster
uses 0 for unsuitable and 1 for suitable, then what combination of these rasters gives us overall
suitability?
A Suitability Analysis: Spatial Analyst, Raster Data, and DEMs - Coursera Specialization in Geographic Page 37
Information Systems. Copyright 2016 Regents of the University of California
A Suitability Analysis: Spatial Analyst, Raster
Data, and DEMs
We're looking for the locations where all of the rasters have a value of 1, correct? That's where each of
suitability requirement is met. To get a resulting raster indicating those locations, we'll again use raster
calculator. In previous expressions, we've used the & operator to chain requirements - saying multiple
criteria must be met. We'll do the same here. Once again, it's a question, but it's written a little
differently. Since 0 is always "false" and 1 is always "true" we can jut chain together the layer names.
For example, putting "nav_habcoastdist_lte35" is equivalent to "nav_habcoastdist_lte35" == 1 in this
instance. Knowing that, what does our full expression look like?
The expression you'll want to put in should be something akin to "nav_habcoastdist_lte35" &
"nav_habelev_50_250" & "nav_habaspect_225_315" & "nav_habslope_gt20" & "nav_oldgrowth"
Again, double clicking the layer names from the box instead of typing them will get the quoting correct
for you, but if you already know that you're using the correct quotes, go ahead and type it in. Read
through that expression and make sure it makes sense to you. Save it in your Products geodatabase
(data\products.gdb) as nav_marbled_murrelet_suitability
You'll get another raster as a result, effectively answering the question of "where is suitable habitat for
the marbled murrelet" as the 0 and 1 value set we've seen before (top image, below). Set the
symbology for the 0 values to transparent, and the 1 values to something like a blue, then show it with
A Suitability Analysis: Spatial Analyst, Raster Data, and DEMs - Coursera Specialization in Geographic Page 38
Information Systems. Copyright 2016 Regents of the University of California
A Suitability Analysis: Spatial Analyst, Raster
Data, and DEMs
just your DEM/Hillshade combination below it (bottom image, below). Examine the locations. Does it
seem like there are limitations to the analysis? What are they? Does the habitat show up where you'd
expect it to?
• Examine your output. How do they differ from the Old Growth patches?
A Suitability Analysis: Spatial Analyst, Raster Data, and DEMs - Coursera Specialization in Geographic Page 39
Information Systems. Copyright 2016 Regents of the University of California
A Suitability Analysis: Spatial Analyst, Raster
Data, and DEMs
• What about the quality of the patches, are there characteristics that might need further
investigation?
• What other data layers would be helpful to address this problem statement?
• Why would one use a PERCENT SLOPE versus a DEGREE SLOPE algorithm on a DEM?
• What other habitat related information could be generated from your identified nesting patches?
• If this were a probability exercise, as opposed to presence/absence, which data might you use
as a weighting term?
• Why use fixed vs. temporary file names for raster data?
A Suitability Analysis: Spatial Analyst, Raster Data, and DEMs - Coursera Specialization in Geographic Page 40
Information Systems. Copyright 2016 Regents of the University of California
A Suitability Analysis: Spatial Analyst, Raster
Data, and DEMs
What is the area of each habitat patch? Hint: you will need to string together a series of commands to
isolatte each patch and calculate its area.
2. Syntax: RegionGroup("nav_mm_patch")
Does this raster command sequence make sense? What does the data in the final raster even mean?
Look up each command in ArcGIS Help.
A Suitability Analysis: Spatial Analyst, Raster Data, and DEMs - Coursera Specialization in Geographic Page 41
Information Systems. Copyright 2016 Regents of the University of California