Lab 7: An Introduction to Raster Analysis

Lab 7: An Introduction to Raster Analysis
Points: 15
Purpose
In recent labs, you’ve been learning to manipulate and analyze vector data. This week we shift our
focus to analyzing raster datasets. Raster analysis allows much more flexibility for certain types of
overlay analysis, for instance where you are looking for very small geographic areas that meet large
numbers of criteria.  In this lab you will be introduced to some of the most important raster analysis
functions in ArcGIS and then will apply them in order to solve environmental planning problems.
Among the functions you will learn are slope and aspect generation, raster queries, raster
calculations, raster distance grids, zonal statistics, viewshed analysis and raster analysis masks.
Downloading lab data
Download today’s lab data as usual and extract it into a new, empty “Lab7” directory. It is important
that the directory you unzip to (i.e. Lab) be empty because we’ll be working with raster data sets
which have a complex file structure and can easily be corrupted.

Open ArcCatalog and navigate to your Lab7 directory. You should see two shapefiles (rich_bound
and rich_streams) and a sub-folder called lab7_data, within which are an additional five shapefiles
(parcel_rich, rds_chit, rich_trails, tower1 and tower2), a layer file (lu_chit) and two raster datasets
(lu_chit and ned_chit). Before proceeding, look carefully at the folder structure and make sure you
do not have redundant names. If you have too many nested subfolders with similar names, you are
going to get confused (for example, do not have lab7_data folder containing another folder called
lab7_data). Remember that it is possible to create a folder connection in ArcCatalog to a folder
(such as lab7_data) and not be able to see data that are in the containing folder above it.
Part 1: Getting started
The data for this lab describe different features of Chittenden County, Vermont. At the county level
the data includes a Digital Elevation Model (from the  – ned_chit), land  National Elevation Dataset
cover (from the   – lu_chit) and major roads (rds_chit). For the town of  National Land Cover Dataset
Richmond there are parcel boundaries (parcel_rich) and trails (rich_trails). There are also two
layers showing proposed sites of a cell phone tower (tower1 and tower2). Don’t forget that there are
two other shapefiles in the parent folder (your new lab folder). Make sure that you can also see these
two shapefiles (rich_bound and rich_streams) in ArcCatalog.

Start ArcMap and make sure the Spatial
Analyst extension is enabled (Customize
>>> Extensions >>> Spatial Analyst). Add
the roads and elevation data. We also want
to include the land use layer, but instead of
adding the raster dataset, add the land use
layer file. We can tell the difference
between the layer file and the raster dataset
Figure 1: The contents of the sub-folder in today’s lab directory.
NR 143 Fundamentals of GIS. By Austin Troy, Brian Voigt & Ernie Buford ©2011
by their icons (or file extensions) as seen in Figure 1-1 and Figure 1-2, respectively. The difference
is that the raster dataset is the actual data, while the layer file is a file that I created containing the
correct color scheme and labels for displaying the contents of the raster dataset. The lyr file does not
actually contain the raster data, but it references the data. If, when you add the lu_chit layer file,
you see an exclamation point next to it in the TOC ( ), the layer file can’t find its data
source (the actual lu_chit raster dataset). To fix this, open the Layer Properties interface for the
lu_chit layer and select the Source tab. Click “Set Data Source”, browse to your Lab 8 directory and
select the lu_chit raster dataset and click “Add” and “OK.”  Set ned_chit as the only visible layer.
Part 2: Hillshade
This week, we are learning about several surface analysis tools (e.g. hillshade, slope, aspect) in the
Spatial Analyst Tools toolbox. Today we’ll use these tools for our analysis, starting with the
Hillshade Tool. A hillshade provides the shadows for a terrain relief map. A hillshade does not
contain elevation values but is derived from them. We can drape any raster or vector dataset over a
hillshade to get the effect of a “painted” terrain map by making the top layer transparent.

Search for the Hillshade Tool (or open the tool from Spatial Analyst Tools >>> Surface >>>
Hillshade). Set the Input Raster to ned_chit and the Output Raster to hill_chit (located in the
subfolder of your lab folder). Accept the default values for the remaining fields and click OK. You
should see a shaded relief map of Chittenden County.

To drape the land cover data over your hillshade, make sure the lu_chit layer is on top of hill_chit in
the TOC. Make sure both layers are visible. Open the Layer Properties window for the lu_chit layer,
select the Display tab and set the Transparency to 40%. Click OK to reveal a shaded relief map
“painted” by the land cover class each area represents (see Figure 2).

Figure 2: Chittenden County land cover draped over a hillshade.
NR 143 Fundamentals of GIS. By Austin Troy, Brian Voigt & Ernie Buford ©2011
Set the scale to 1:100,000, center anywhere and take a screenshot of the entire ArcMap
interface. Your data should look like Figure 2. If the display looks wrong, make sure that you have
to correct layers in the proper order and that you set transparency for the top layer only.
Part 3: “Clipping” a Raster Dataset
The study boundary for today’s lab is the greater Richmond, VT area. To save on disk space and
increase our processing and analysis efficiency, we will “clip” our landuse, hillshade and NED grids
to the extent of our study area. Add rich_bound (the town boundary of Richmond) and create a 2
Kilometer buffer around the polygon. Save the buffer as RichBuffer2K in your lab directory. It is
important to always pay attention to the location where output will be created when running
geoprocessing tools (the default location is often not desirable!).

Before we “clip” (or do other processing with) our raster data, we need to specify Environment
Settings. Select Geoprocessing >>> Environments to open the Environment Settings interface.
Expand the Processing Extent section (by clicking on it), and from the Extent dropdown box choose
“Same as layer RichBuffer2K” (see Error! Reference source not found.). The coordinate boxes
that were initially blank should now be populated with the same bounding coordinates as the
Richmond buffer feature class (you can confirm this by looking at the Layer Properties for
RichBuffer2K.). The Processing Extent establishes the spatial (rectangular) extent of future
selections (for vector data) and processing (for raster data). Next, expand the Raster Analysis section
and select ned_chit from the Cell Size dropdown box and RichBuffer2K from the Mask dropdown
box. The Cell Size parameter ensures a consistent grid cell size for all subsequent raster datasets
derived in the current ArcMap project. The Mask specifies the region within which data processing
occurs. Any data outside the mask will not be included in data processing. Click OK to finalize your
Environment Settings.

Figure 3: Setting the Processing Extent in the Environment Settings
Environment settings:

Extent: RichBuffer2K

Cell size: ned_chit

Mask: RichBuffer2K

Important note: these settings affect
all subsequent geoprocessing
operations. If you quit ArcMap
before finishing the lab and then
pick it up later where you left off,
you will need to set these
environment settings again or you
will not get the correct results.
NR 143 Fundamentals of GIS. By Austin Troy, Brian Voigt & Ernie Buford ©2011
interface.
Once the Environment Settings are properly specified, you are ready to “clip” all of the raster data
used in the remainder of the lab. “Clipping” a raster dataset is different from clipping a vector
dataset. Navigate to Spatial Analyst Tools >>> Extraction >>> Extract by Mask. Set the Input
Raster and Feature Mask Data to ned_chit and RichBuffer2K, respectively. Name the Output raster
RichNED, and save it in your lab directory. If you turn all layers except RichNED and
RichBuffer2K off, you should see that RichNED covers the same spatial extent as RichBuffer2K. Do
the same Extract by Mask for the landuse and the hillshade data, naming them RichLandCover  and
RichHill, respectively.

Note that the newly clipped RichLandCover layer does not include the same legend symbology as
lu_chit. You could manually recreate the display from Layer Properties >>> Symbology, however, it
is much easier to apply the layer file (lu_chit.lyr) we discussed in Part 1. To do this, open the Layer
Properties >>> Symbology tab for RichLandCover and click on the Import button in the top right
of the interface; choose lu_chit from the Layer dropdown menu and click OK. The colors and labels
on the Symbology tab should now look like those from the initial lu_chit layer. Set the transparency
for RichLandCover to 40% (on the Layer Properties >>> Display tab), and click OK again to close
the Layer Properties interface. If necessary, move RichLandCover above RichHill in the TOC.

Zoom to the extent of RichBuffer2K, turn off all layers except RichLandCover and RichHill
and take a screenshot of the entire ArcMap interface. Make sure that the legend for the land cover
and hillshade layers are visible in the TOC.

Before moving on to the next section, clip the roads data to the extent of the Richmond buffer. Use
what you learned in the vector geoprocessing lab to accomplish this. Save the output as RichRoads
in your lab directory.

Remove all of the county-wide layers from the view. There should be two vector layers (RichRoads
and RichBuffer2K) and three raster layers (RichLandCover, RichHill and RichNED).
Part 4: Slope and Aspect
Next we are going to generate slope and aspect layers, based on our DEM. Find the Slope Tool and
set the Input Raster to RichNED, the Output Raster to RichSlope and the Output Measurement to
DEGREE. Leave the default value for the Z factor and click OK. Use the Aspect Tool to create an
aspect layer based on the DEM (RichNED). Name your Output Raster RichAspect. Make sure to
save these layers in your Lab directory. Inspect the results. Do the new raster layers make sense to
you? (A common mistake is to use something other than elevation as the input layer, which might
produce results, but those outputs will NOT be slope and aspect.)

NR 143 Fundamentals of GIS. By Austin Troy, Brian Voigt & Ernie Buford ©2011
Part 5: Raster Queries
Suppose you are the town planner for Richmond and you need to make a decision regarding a
pending subdivision application. There are a number of rules which establish siting guidelines for
new development. In order to make a permit decision for the subdivision application, you need to
identify sites that are not developable for environmental reasons; including the presence of wetlands,
steep slopes, high elevation zones and south-facing deciduous forests (I made that last one up). You
are going to use multiple raster queries to identify the places in town that meet these criteria.
Although this could be done in a single step, you’ll use multiple queries. Let’s start by identifying all
south facing slopes covered by deciduous forests. Since there are two conditions (one for each
dataset) to be met here – deciduous forest and south facing – use the AND operator in your query.

Raster Query Tips

Unlike Select by Attributes, which uses the word “AND” and “OR” for the respective
logical operators, Raster Calculator uses a different syntax. Notes on a few of these
operators:

  &       the ampersand performs a logical AND
  |         the “pipe” performs a logical OR
  ==      the double equal tests equality (vs. setting something equal to…)

In complex (multiple criteria) queries, criteria on either side of a logical operator must
be independent. For example, if we want to query a dataset called “raster1” for values
equal to 4 or 8, we would use this query:

(“raster1” == 4) | (“raster1” == 8)

The following popular alternative query will NOT work (because one criterion is now
simply an integer value – 8 – and will always evaluate as TRUE):

“raster1” == 4 | 8

Query expressions are evaluated in order determined by parentheses and precedence
level of operators. It is generally a good idea to use parentheses liberally to control
expression evaluation. If necessary, consult the Map Algebra documentation for
guidance.

Open the Raster Calculator (Spatial Analyst Tools >>> Map Algebra >>> Raster Calculator) and use
your mouse to create a query whose syntax matches what you see in Figure 4 (every character
counts!). The code for deciduous forest in the land cover dataset is 41. The aspect data derived from
the DEM has a continuous numeric scale, and you want to select all cells within 10° of true south
(180°). Finally, use the AND operator (&) to join the two query components — land cover class and
aspect. (Why not OR?) Name your Output Raster RichStep1 and save it in your lab directory.

NR 143 Fundamentals of GIS. By Austin Troy, Brian Voigt & Ernie Buford ©2011

Figure 4: Raster Calculator query to select south-facing forested slopes in Richmond.
The query result is a raster dataset with two values: 1 in locations that met criteria and 0 in areas that
did not. Render the 1’s with a bright color and make the 0’s invisible by setting their Fill Color to
“No Color.” Turn off all layers except RichHill and RichStep1 to view the results of your query.

Great, you have identified some of the off-limits area but need to add the rest. Open the Raster
Calculator. You’ll combine the results of our first query (RichStep1 = 1) with criteria for wetlands
(RichLandCover = 61 or 62), steep slopes (RichSlope > 40) and high elevations (RichNED > 2500).
Use what you’ve learned today to create a query in Raster Calculator that identifies all pixels that
meet any of the criteria specified in the previous sentence. Name your Output Raster RichOffLimits
and save it in your lab directory.

Note: There are no “AND” operators in this query, only “OR” operators. Remember, the “OR”
operator in Raster Calculator is represented by the “pipe” or vertical line symbol (|).Make sure that
each “piece” of the query is surrounded by parentheses (see Figure 4).

Set the 1’s to a bright color and make the 0’s invisible in the query result (RichOffLimits), and
make the layer 40% transparent. Overlay RichOffLimits and RichRoads (make sure the roads are
visible) on the Richmond hillshade layer, turn off all other layers and take a screenshot of ArcMap.

[Q1] How much area was identified as off-limits in the second query? Figure this out by
opening the RichOffLimits raster attribute table and finding the COUNT of cells with value 1.
Multiply the number of cells by the cell size (26.5649 m x 26.5649 m). Give your answer in
acres and in number of cells. (1 m
2
= 0.0002471 acres)
NR 143 Fundamentals of GIS. By Austin Troy, Brian Voigt & Ernie Buford ©2011
Part 6: Distance Rasters and Raster Queries — Site Selection
Now that you’ve determined locations suitable for subdivision development, it’s time to start looking
for areas in town that meet minimum suitability requirements for your new cabin, including sites that
are far from the Interstate and Route 2 (RichRoads) but are near one of the town trails (rich_trails).
Add the layer called rich_trails, which is a trails layer that has already been clipped to the extent of
the buffer. This time, we’re going to base our query on the distances from our roads and trails layers.
A distance surface calculates the distance from a pixel to the nearest feature in a vector layer.

To create a distance raster based on RichRoads open the Euclidean Distance Tool. Set the “Input
raster or feature source data” parameter to RichRoads and the “Output distance raster” parameter to
d2rds in your lab directory. Notice that the Output cell size parameter matches the cell size we
specified in Part 3. The distance to roads surface you create should look similar to Figure 5.

Next, create a cost-weighted surface to the trails
layer. Pixels with steep slopes contribute more
cost to the distance value than pixels with gentler
slopes. Open the Cost Distance Tool. Set the
“Input raster or feature source data” parameter to
rich_trails, the “Input cost raster” to RichSlope
and the “Output distance raster” to d2trails. You
should now have a raster dataset showing the
distance of each pixel to the nearest trail,
weighted by the slope steepness between the
pixel and the nearest point on the trail. Therefore,
a pixel that is 100 m from the nearest trail, but is
only accessible via steep slopes has a higher cost-weighted value than a pixel that is 100 m from
the nearest trail but is accessible via flat surfaces.

Change the d2trails transparency to 40%, the Symbology to “Stretched” and choose a color
scheme with enough contrast to easily distinguish between the layers. Take a screenshot of ArcMap
showing the trails and d2trails overlaid on top of the hillshade (with all the other layers turned off).

To complete the analysis, you need to identify pixels that are near trails (< 1000 m), when
accounting for slope, and far from major roads (> 2000 m). Name the query output CabinSites.
Display CabinSites with invisible 0’s, brightly-colored 1’s and transparency set to 40%.

Overlay CabinSites on the hillshade, along with the roads and trails layers and take a
screenshot of ArcMap (with all other layers turned off).

[Q2] What is the area of the suitable cabin sites identified in the analysis?

[Q3] If we want the cabin sites to be located in a deciduous forest (RichLandCover = 41) or a
mixed forest (RichLandCover = 43), in addition to the criteria we specified to calculate
CabinSites, what would the query syntax be? (Hint: (“CabinSites” == 1) & …)
Figure 5: Distance to roads in Richmond.
NR 143 Fundamentals of GIS. By Austin Troy, Brian Voigt & Ernie Buford ©2011
Take a break!

You are closing in on the end, but the next sections require a lot of thinking and mental
energy. I recommend taking a break here to clear your head before proceeding with
section 7.

Part 7: Viewshed Analysis and Zonal Statistics
Your next permit review concerns siting a cell phone tower to minimize visual impacts to local
residents. You will use viewshed analysis to quantify the visibility of the proposed cell phone tower
sites. Viewshed analysis identifies locations on the landscape that are visually connected to a given
point (or series of points) by determining site lines that account for topography and other visual
disruptions. The result of a viewshed analysis is a raster dataset with values of 1s and 0s, indicating
which pixels are visible and not visible, respectively. Add the layer tower1 to the current ArcMap
project. Choose a symbol that is large and easily visible.

Open the Viewshed Tool, set the “Input raster” to RichNED, the “Input point or polyline observer
features” to tower1, the “Output raster” to T1Viewshed, accept the other defaults and click OK.

Drape the T1Viewshed over the hillshade. Make the 0s invisible, the 1s a bright color and the
transparency 40%. Add the parcel layer (rich_parcels) to your ArcMap project, set the Fill Color to
“No Color” and the Outline Color to a line weight of 1.5 with a color that contrasts with the other
layers. Zoom to the extent of the parcel layer and take a screenshot of ArcMap (see Figure 6).

Figure 6: Viewshed analysis for Tower 1.
NR 143 Fundamentals of GIS. By Austin Troy, Brian Voigt & Ernie Buford ©2011

Now calculate zonal statistics to determine the number of impacted parcels and the area of impact
within each parcel. The Zonal Statistics Tool summarizes the value of pixels within the boundaries
of the features of the zone dataset. Open the Zonal Statistics As Table Tool. Set the “Input raster or
feature zone data” to parcel_rich, the “Zone field” to PAR_ID and the “Input value raster” to
T1Viewshed. Name the “Output table” Tower1ZStats. Accept the other default values and click
OK.

You have created new information about tower visibility for each parcel, but those statistics are in a
separate table. Tower1ZStats contains the new information for each parcel and has an identifier (the
“Zone field”, PAR_ID, that you used above) to relate statistics to parcels (remember the relational
database model?). Now you need to get that new information into the attribute table for the parcel
layer so that it can be used as a basis for querying or symbolizing parcels.

Join Tower1ZStats to parcel_rich on PAR_ID and PAR_ID, respectively, and open the attribute
table for the parcel data. Be careful not to confuse PAR_ID with the similarly-named field PAR_.
Remember that you open the “Join” interface by right-clicking the destination table – i.e., the
dataset or table that you want to join something to. It is a common mistake to right-click the Zonal
Statistics output table and join the parcel attribute table to the statistics table (which does not
achieve our objective of getting more, new information into our parcel polygon attribute table!).

Joins tip!

Mistakes with table joins need to be corrected before attempting to redo a join the
proper way. If  table A has been joined to table B, one cannot then join table B to table
A (it is not allowed, for what should be obvious reasons).

The “Join and Relates” menu accessible by right-clicking on a layer or table in ArcMap
has a “Remove Joins” option that can be used to remove an erroneous join.

After the join, the parcel attribute table should look like Figure 7. The PAR_ID* column
(highlighted in red in Figure 7) is where the results of the zonal statistics begin. If your table does
not look like this then you might have done the join the wrong way (did you join Tower1ZStats to
parcel_rich or vice versa). Note that some parcels have <null> values for the Zonal Statistics fields.
Can you determine why?

Figure 7: The zonal statistics table joined to the parcel data.
NR 143 Fundamentals of GIS. By Austin Troy, Brian Voigt & Ernie Buford ©2011
Now think about what these statistics tell you. Right click on a field heading and open “statistics”
to look at statistical summaries of some of the zonal stats fields (statistics of your zonal
statistics!). Note that some of these statistics have special meaning because all of the pixel values
in the visibility raster are either 1 or 0. Each of the next two questions can be answered using
only these zonal statistics fields, the statistics tool and a single attribute query.

[Q4] If a parcel record has a MAX of 0, what does that mean? If a record has a MAX of 1 and
MIN of 1, what does that mean?

[Q5] Use the statistics tool to figure out how many parcels have at least one pixel that has line
of sight with the proposed tower. Use it again to figure out how many parcels have line of site
for at least 50% of their land area.

Now use graduated color (i.e., make a choropleth map) to display the mean pixel value for
each parcel. Set parcel layer transparency to 40% and overlay it on the hillshade, with no other
layers visible. Take a screenshot of ArcMap.
Part 8: Comparing the Visibility of Alternative Tower Sites
Suppose the developer proposes a second tower site and wants you to compare the visual impacts of
each tower to see which site has a less significant impact on the residents of Richmond. Add tower2,
which like tower1 includes a single point. Run a viewshed analysis on tower2 and again, use the
Zonal Statistics As Table Tool to summarize visibility by parcel (set the Zone field to
parcel_rich.PAR_ID). Name the “Output table” Tower2ZStats, and join it to the parcel layer. The
join field for the parcel data will be called parcel_rich.PAR_ID.

Note: The “parcel_rich.” prefix indicates that the parcel_rich layer is currently joined to another
table (or layer). In this case, the parcel data is still joined to the zonal statistics table for tower1.

There are now two tables (Tower1ZStats and Tower2ZStats) joined to the parcel layer. It is not
obvious from the Table View which attributes are from which zonal statistics output. However,
when we query the parcel data (using Select By Attributes) determining the origin of the attributes
becomes clear. The attributes for the parcel data, Tower1ZStats and Tower2ZStats begin with
parcel_rich., tower1zstats. and tower2zstats., respectively.

Suppose the Richmond Select Board wants to know which tower has a smaller impact on the
residents in their town. They ask you to answer the following questions.

[Q6] How many parcels have line of site visibility under each tower scenario?  How much land
area within Richmond has line of sight visibility under each scenario? (Remember, the
viewshed analyses results include pixels that are outside the boundaries of Richmond, so your
first step will be to “clip” [extract] the viewshed rasters with the Richmond town boundary
polygon.)

Finally, add a new field called vis_cat to the parcel layer with data type text. Query the parcel data
to find all the parcels with more than 25% of their pixels in the line of sight of tower 1 (this will
NR 143 Fundamentals of GIS. By Austin Troy, Brian Voigt & Ernie Buford ©2011
require an attribute query using one of the zonal statistics fields… can you figure out which field to
use? If 25% of a parcel has visibility, one fourth of the pixels in that parcel will have a value of 1).

Tip: Adding & Calculating Fields

Problems can sometimes occur when you add fields or calculate fields in a table that has
been joined with another table. If either operation (Add Field or Field Calculator) does
not work properly, you should try removing any joins before adding a new field. You
can always delete a field that has no (or corrupt) values and then add it again.

Note that setting the wrong field type (e.g., text vs. short integer) can be problematic. If
you have the wrong field type, delete the field and add it again with the correct type.

When you have selected parcels with more than 25% area having visibility, use Field Calculator to
set the value of vis_cat to “Tower1” for the selected records (you must include the quotes, which
indicate a text string). Do the same query-and-calculate process for tower 2, (set the value of vis_cat
to “Tower2” for the selected records this time). Finally (and this must be done in the proper order)
query the data to select the parcels with more than 25% of visibility of both proposed tower
locations and set the value of vis_cat to the text string “BothTowers.”

When these queries and field calculations are completed, you will have an attribute – vis_cat – that
can be used to map or quickly identify parcels based on which towers, if any, are visible from more
than 25% of the parcel’s area. This information can now be used to create the final display.

Create a map of the parcel data (40% transparency) draped over the hillshade. Use “vis_cat” as
the Value Field and select Unique Values as the display method. Turn all the other layers off and
take a screenshot of the resulting map. Make sure that your image shows the parcel data legend (in
the TOC).

Place this order with us and get 18% discount now! to earn your discount enter this code: special18 If you need assistance chat with us now by clicking the live chat button.

© 2020 customphdthesis.com. All Rights Reserved. | Disclaimer: for assistance purposes only. These custom papers should be used with proper reference.