In-Class Exercise 11.1 Viewsheds

This exercise, together with the Ex. 11.2 Cost Surfaces, belongs to the Terrain Analysis section of the course. These techniques are presented together because they involve many of the same limitations of source terrain data and similar assumptions about phenomena being modeled with these methods. Please see ch. 10 of the Wheatley and Gillings reading for further discussion.

There are several types of visibility analysis available in ArcGIS. We will visit two of these types using the Callalli study area DEM. Note that an SRTM DEM at a similar 30m cell resolution can be acquired for other study areas around the world (minus the polar regions over 60° latitude) following the instructions in Ex. 5 of this course

Instead of using the archaeology data from other exercises in this course I've prepared a new Sites file that includes a larger area and a simplified Sites shapefile with only time periods assigned.

Download the ~10mb "Ex11.1_Views_Costs" file Links to an external site. and uncompress to a path in /Documents with no spaces. Be sure to extract the contents of the Zip you download. Your system may allow you to load data from inside a Zip file but it taxes the system and Arcmap will likely fail.

Open the following toolbox

ArcToolbox > Spatial Analyst > Surface >
ESRI has a number of tools with overlapping functionality

  • Observer Points Links to an external site. - Calculates the number of observers that can see a given location and returns a look-up matrix that identifies specifically which observer (based on its id) or combination of observers can see a given location.Limited to a maximum of ~200 combinations.
  • Viewshed Links to an external site. - Calculates the number of observers that can see a given location. No identification is given as which observers can see that location. The result is simply a single numeric value. If you have 10 viewpoints, then your resultant raster will have values in the range 0 - 10.
  • Visibility Links to an external site.Similar to Viewshed but supports parameters and Frequency versus Observer results.
  • Viewshed 2 Links to an external site. –New in 10.3. Provides more parameters, 3d Distance measure, and vertical error RMSE. Uses Nvidia Graphics Processing Unit to speed analysis.inclass11.1.png

A. Simple total viewshed

Open the Sites table and look at the values. These are artificial data I created just for the viewshed and the cost surface exercises. Note that the 16 site locations belong to two time periods and we’ll assume each temporal group of sites were occupied concurrently.

Let’s generate a simple Viewshed 1 map to see how the basic tool works.

1. clear any selection you may have.  Bring in the data from In Class Exercise 11 to Arc Map.

2. arctoolbox > spatial analyst > surfaces > Viewshed

 Select srtm30m DEM as your Input Raster

  • Sites as your Input Point features.
  • Leave the other fields blank.inclass11.2.png

 

Look at the output. Note the Green is visible, pink invisible. Drag the srtm30_hs (hillshade) layer up so it’s above the Viewshed output. The hillshade should be changed to 60% transparency so this shades the terrain together with the viewshed results and helps visualize what is happening.inclass11.3.png

inclass11.4.pngOpen the attribute table for the View output. The Value field indicates how many of the observer (site) locations can see a given cell, and Count shows how many cells fall into that group. There are three cells in this DEM that are visible from 8 site locations making this a high visibility location.inclass11.5.png

What other issues do you perceive with this simple viewshed analysis? What’s missing? First, this a simple binary “all viewable areas” so it doesn’t give us much insight into differences between sites or time periods. Second, there’s no refinement about the height of the observer or the targets, nor the maximum distance the view should incorporate which pertains to the size and visual distinctiveness of the target.

*NOTE: The Viewshed 1 tool has always supported a number of these parameters but they’ve made it a little simpler by putting them into a wizard interface. That is, you could create a number of Fields in the Sites Attribute table and based on what they were named the values were usedi n the analysis. A field called OFFSETA contains the value for Observer height, and RADIUS2 was the maximum distance a viewshed should extend. The Fieldnames were: SPOT, OFFSETA, OFFSETB, AZIMUTH1, AZIMUTH2, VERT1, and VERT2 (see help Links to an external site. for a full description)

Further, you could constrain your analysis by providing a subselection of Observer feature points for example based on different time periods.

These factors, together with additional features, are incorporated into the Visibility tool which we’ll use now. Just keep these points in mind.

B. Visibility Analysis - differences between time periods

Missing from the previous analysis was a temporal question as part of the inquiry. Obviously, you can select a single site and run a viewshed and find out the resulting area. But how is this different from just going to the site and looking around and taking photos?
You could also select a line and find the viewshed along a road, for example. However, computers can answer interesting questions by looking at general patterns with larger datasets. This is where computers give you an advantage because you're repeating many small operations.

We want to answer questions such as:

How do viewsheds change based on the type of site that is being evaluated?
Are Late sites more or less likely to be constructed such that they can view one another?

We can calculate separate viewsheds for each group of sites in our table by manually selecting each group from the Attribute Table and running the viewshed calculation. If you have many time periods or viewshed ranges you would like to test consider using Model Builder.

Calculate viewshed for each major group:

  1. First let’s select just the Early sites in the Period column.

Next run

ArcToolbox > Spatial Analyst > Surface > Visibilityinclass11.6.png

Output Raster: Visibil_Early

Click in the Analysis Type box and read the Show Help information.

The Analysis Type parameter is important. We're going to use FREQUENCY however switching from FREQUENCY to OBSERVERS type creates a column in the output for each observer location and a row for combination of observers for cells in the input raster.

Open the Observer Parameters list and Click Observer Elevation and read the Show Help box.

Leave Analysis Type as FREQUENCY.

Click in each entry field and read the description.

 

  • In the Observer offset field enter:  1.5 (meters)
  • For Outer Radius enter: 5000 (meters)
  • Scroll down and view Help Info for each of the remaining fields.inclass11.7.png

 

We’re asserting that the viewer's eyes are at 1.5m above the ground, and we want to know the surface visible within 5 km of each site.

View the output. Open the attribute table and select one row.

II. Repeat with just Late sites selected in Period column.

Name the Output Raster Visibil_Late [Note that even with the Visibility tool open Arcmap lets you open the Sites attribute table and change your selection]

III. Inspect Results

Drag the Hillshad “SRTM30_HS” layer up the list so it is overlayed on the new layers.

Now we have rasters showing the Early and Late period visibility relationships. These rasters are symbolized in a simple classification but we are interested in the details so let’s alter the symbology of both of these layers to show “Unique Values” on a simple color ramp scheme (Red for Early and Blue for Late) with 0 being light red/blue and 3 or 5 being dark red/blue.

Analysis:

Open Visib_Early: 29140 visible from at least 1 site, 7816 from 2 sites. With Late 63742 visible from 1 site, 12845 from 2 sites. So LATE sites have more visibility on the whole. Yet 29 cells in the Early sites analysis can sometimes be seen from the 5 sites where as LATE sites only ever have 3 sites viewing the same cells in common.inclass11.9.png

It appears that Early Period sites are more aggregated and have higher intervisibility, and visual inspection confirms that view.

IV. Cumulative Viewshed Results

Let’s query the raster cell under each point to investigate this pattern.

Use Spatial Analyst > Extract > Extract Values to Points

           Input: Sites (with Late sites selected)

           Input Raster: Visibil_Lateinclass11.11.pnginclass11.10.png

Repeat: Input: Sites (with Early sites selected)

           Input Raster: Visibil_Earlyinclass11.12.png

Inspect the Attribute Table and consider what the Raster Values are showing. Alter the symbology to show Quantities > Graduated Symbols using RASTERVALUE with Red dots for Early and Blue dots for Late.inclass11.13.png

inclass11.14.png

C. Comparison with Random

As we read in Lake and Wooman (1998) one way to compare visibility from a particular time period to general visibility in a region is to calculate the viewshed for 100 randomly located points and compare them with the two time periods (in the interest of time we’re using relatively few random points here).

We’ll use the Create Random Points tool

toolboxes\data management tools\feature class\create random points

  • Output Feature Class: Rand100
  • Constraining: Study Area
  • Number of Points: 100
  • Minimum Allowed Distance: 50 metersinclass11.15.png

inclass11.16.png

Next we’ll calculate visibility for these 100 locations using the same settings

1.5 m observer vertical offset and 5000m Radius2 maximum view.inclass11.17.png

We have two issues with Edge effects. The first is that the eastern margin of the study area is adjacent to the edge of the DEM so the total number of cells viewable from a single observer point is mis represented due to there being no data to the east. Two solutions to this situation present themselves: move our random sample space westward to avoid the edge, or to get more DEM data for the east side.

If the green “Visible” area extends off the edge of the DEM what effect does that have on our totals and calculations? 

inclass11.18.png

Next use the Spatial Analyst > Extract > Extract Values to Points...

Look at the Attribute table.

Another insidious edge effects problem arises: due to all the edges of the random sample region the Extracted Values are going to be under represented because observer points do not exist outside the study area box so there are fewer locations observing the sampled locations. The prevalence of low-viewed cells (lightest green) on the periphery of the study area in the screen shot below displays this issue. One expedient solution is to simply Extract Values only from Random Points in the middle of the stud yarea where the edge effect is not present. In the screenshot below note that ~50 points in the center of the study area are selected.

visib_rand_samp-1.JPG

This leaves only 50 points in our random sample which isn't very many. If you can allow the computer to run for 30-60 minutes I would allow it to gather many more points, say 500 or 1000 in a somewhat expanded study area so that the edge effects are displaced outward away from the actual data of interest. Note that Lake and Woodman 1998 use every cell in a raster! 

 

Assess the Results

Now we can graph these results to explore the question: Sites from which of the two time periods have the highest mean visibility with respect to the Random viewshed?

We’ll keep it brief here and simply look at the summary statistics (right click the top of the RASTERVALUE field in the Attribute Table).

For the Random sites the results for my selection of 50 points in the center were

  • Mean: 2.68
  • Stan Dev 1.36

being random everyone will have different values. Note that if all 100 random cells are included the Mean drops to 2.3 so the edge effect is real.

Compare that with the RASTERVALUE statistics in Early and Late Period sites. Which group has the highest Mean and Standard Deviation?

A statistical approach would have us compare the randomly generated viewshed with the cumulative viewshed from Early and Late period sites and determine the strength of the hypothesis that the patterns observed could have not have arisen by chance.  This is demonstrated in the Lake and Woodman article. First one would take the results to a statistics package and look at descriptive statistics to see if the data is normally distributed. Next one would either transform the data to approximate a normal distribution or use non-parametric statistics to assess the strength of the pattern.

The non-parametric statistic that is often used to compare viewsheds is the two-sample Kolmogorov-Smirnov also known as "KS". It is avaiable in some stats packages like SPSS. This website describes a free plugin for MS Excel to provide the KS statistic. Links to an external site.