>  Docs Center  >  Using ENVI  >  Viewshed Analysis Tutorial
ENVI

Viewshed Analysis Tutorial

Viewshed Analysis Tutorial

In this tutorial, you will use the Viewshed Analysis workflow to determine visibility from different view sources. Use ENVI 5.3, Service Pack 2 or later. This tutorial takes approximately two hours to complete.

See the following sections:

Files Used in this Tutorial


Tutorial files are available from our website in the viewshed directory.

File

Description

NEONBoulderDSM.dat

Digital surface model (DSM) mosaic of Boulder, Colorado with 1-meter spatial resolution, acquired on 26 June 2013, saved to ENVI raster format 1

NEONBoulderDSM.hdr

Header file for above

NAIPBoulderAirphoto.dat

Aerial image mosaic of Boulder, Colorado from the National Agriculture Imagery Program (NAIP), 1-meter spatial resolution, saved to ENVI raster format 2

NAIPBoulderAirphoto.hdr

Header file for above

1 National Ecological Observatory Network. 2014. Data accessed on 24 February 2016. Available on-line at http://data.neonscience.org/home from National Ecological Observatory Network, Boulder, CO, USA.

2 Data available from the U.S. Geological Survey.

Background


Viewshed analysis refers to the process of identifying locations that are visible from one or more observer points (also called view sources). A gridded elevation product such as a DEM, DSM, or DTM provides the elevation values needed to determine visibility relative to the height above the terrain.

A view source can be a single point, a polyline, or a polygon. With a single view source, the viewshed represents all locations within an unobstructed line of sight to the view source. Viewshed analysis assumes that an observer can move anywhere along or within the source.

With multiple view sources, the viewshed can be defined as either (1) all locations visible from at least one of the view sources or (2) locations visible from all view sources. In addition to specifying multiple view points, you can also use a line or polygon to define a single view source that is approximated by multiple view points.

Example 1: Cameras at Fixed Points


In this scenario you will find suitable locations for four traffic cameras so that they have unobstructed views to a highway interchange within a specified range (200 meters). The cameras have a height restriction of 3 meters and are fixed points; they cannot be rotated.

Follow these steps:

Open and Display Images

  1. In the Search window of the ENVI Toolbox, type viewshed and double-click the Viewshed Analysis Workflow tool name that appears.
  2. In the File Selection panel, click Browse next to the DEM File field, navigate to the \viewshed directory and select the NEONBoulderDSM.dat file, then click OK.
  3. In the File Selection panel, click Browse next to the Image File field, navigate to the \viewshed directory and select the NAIPBoulderAirphoto.dat file, then click OK.
  4. Click Next to proceed to the Viewshed Analysis panel.
  5. When the images display, the NAIPBoulderAirphoto.dat layer should be on top of the display stack. Select this layer in the Layer Manager to make it the active layer.
  6. The Symbol Annotation tool is active in the ENVI toolbar so that you can start adding view points. If you want to explore the image, select the Pan tool in the toolbar.

  7. Locate the highway interchange shown in the image below, and zoom in until you can clearly see it:

Next, you will set some default view parameters and start adding view points.

Set Default View Parameters

The following parameters are used to set default values for all new view sources that you define. If you change these values after adding new view sources, they will not apply to those sources. We will show you how to change parameter values for individual view sources later in this section.

  1. In the Viewshed Analysis panel, enter a Default View Range (meters) value of 200.
  2. Enter a Default View Height (meters) value of 3.
  3. Note: The Default Point Spacing (meters) parameter only applies to polyline and polygon view sources. It does not apply to point sources, which you are about to add.

  4. Select the Visible From option of Any Source.
  5. Click the annotation drop-down list in the ENVI toolbar and select Symbol Annotation. The view points you will add next are considered symbol annotations.
  6. Click in the display in four different locations where you want to add traffic cameras. The following image shows an example of placing cameras on the highway access ramps:
  7. Enable the Preview option.
  8. Click the Select button in the ENVI toolbar, then move and expand the Preview Window as needed to see the viewshed results. Here is an example:
  9. The green areas are locations that are visible from at least one of the view sources (cameras). The red areas extend out to 200 meters as specified by the Default View Range (meters) parameter.

  10. Disable the Preview option when you are finished viewing the results. In the next section, you will change parameter values for each individual view source. Turning off the Preview Window will result in better system performance.

Set Camera View Parameters

In addition to observer height and view range, cameras are further constrained by variables such as field of view, azimuth, and pitch. To more accurately model a restricted viewshed analysis, you must take into account these constraints. The following diagram illustrates these variables:

Assume that each camera has the following constraints:

  • Horizontal field of view: 90 degrees
  • Vertical field of view: 30 degrees

Also, since each camera is positioned to monitor a certain geographic direction (toward the center of the interchange), they have different azimuth values. We will also assume that they are level (Pitch = 0 degrees) and cannot be rotated.

The following diagram shows the top-down view of the four points. The range and horizontal field of view (HFOV) are the same for all four points. They are shown only for View 1 for clarity.

You can set these parameters individually for each view source by editing their properties. Follow these steps:

  1. Double-click each view source in the Viewshed Analysis panel, one a a time, and enter the values shown below in the Property dialog. Ignore the Map X setting; this cannot be changed. Click OK in the Property dialog when finished.
  2. Enable the Preview option to see the viewshed results.
  3. The views are more restricted now for each camera. The green areas represent locations that are visible to at least one camera. This preview confirms that the center of the highway interchange has coverage from at least one camera at any given time.

  4. Try setting the Visible From option to All Sources. Are there any locations that are visible to all four cameras simultaneously?
  5. Click the Save View Sources button .
  6. In the Save view points to a shapefile dialog, enter an output shapefile name and location for the view points and click OK.
  7. Close the Viewshed Analysis workflow dialog to prepare for the next example.

Example 2: Visibility Along a Path


In this scenario, a cellular company would like to place a communications tower so that it has an unobstructed view to all locations on a section of road. You will draw a polyline view source with a narrow point spacing (10 meters) and an tower height of 100 meters.

Open and Display Images

  1. In the Toolbox, double-click Viewshed Analysis Workflow. The Select File panel appears.
  2. In the File Selection panel, click Browse next to the DEM File field, navigate to the \viewshed directory and select the NEONBoulderDSM.dat file, then click OK.
  3. In the File Selection panel, click Browse next to the Image File field, navigate to the \viewshed directory and select the NAIPBoulderAirphoto.dat file, then click OK.
  4. Click Next to proceed to the Viewshed Analysis panel.

Set Default View Parameters

  1. In the Viewshed Analysis panel, enter a Default View Range of 5000 meters.
  2. Enter a Default View Height of 100 meters.
  3. Enter a Default Point Spacing of 10 pixels. Since this scenario demonstrates continuous coverage along a path, a small point spacing (such as 10 or smaller) is required.
  4. Select the Polyline Annotation tool Polyline annotation from the toolbar.
  5. Draw a polyline along the center of any section of road. Left-click to add segments, or click and drag to draw a polyline. Then right-click and select Accept. The following figure shows an example:
  6. In this example the Total Points value is 67, meaning that there are 67 view sources along the path. This number is not the number of points (mouse clicks) that you used to draw the polyline; rather, is the number of points that ENVI automatically determined along the path using the default point spacing of 10 pixels.

  7. Click Show Point Spacing Show point spacing in the Viewshed Analysis panel to see the individual points, identified by small green crosshairs.

  8. Select to calculate the visibility from All Points Within Sources.
  9. Enable the Preview check box. The Preview Window may take several seconds to update because of the large number of view points along the path.
  10. Click the Select button in the ENVI toolbar, then expand the Preview Window so that you can see more of the viewshed.

    The green areas are locations that are visible from all view points along the road.

  11. Close the Viewshed Analysis workflow to prepare for the next example.

Example 3: Find Areas Visible from a Rooftop


In this final scenario you will determine areas that are visible from a high vantage point. It simulates a human observer at various points on a rooftop. You will define a polygon view source for the rooftop, experiment with different parameters, then save the viewshed results to a classification image.

Open and Display Images

  1. In the Toolbox, double-click Viewshed Analysis Workflow. The Select File panel appears.
  2. In the File Selection panel, click Browse next to the DEM File field, navigate to the \viewshed directory and select the NEONBoulderDSM.dat file, then click OK. You do not need to select an image file for this scenario.
  3. Click Next to proceed to the Viewshed Analysis panel.
  4. When the DSM image displays, make it the active layer by selecting the NEONBoulderDSM.dat layer in the Layer Manager.
  5. Locate the pair of tall buildings near the bottom of the DSM image.
  6. Enter a value of 250 in the Zoom drop-down list in the ENVI toolbar. Press the Enter key. The display zooms in to 250%.

Set Default View Parameters:

  1. In the Viewshed Analysis panel, enter a Default View Range (meters) value of 500.
  2. Enter a Default View Height (meters) value of 2. This approximates the height of a human observer.
  3. Enter a Default Point Spacing (pixels) value of 100.

Define a Polygon View Source

  1. From the Annotations drop-down list in the ENVI toolbar, select Polygon Annotation.
  2. Draw a polygon view source along the right (eastern) rooftop. Click to add polygon segments. Try to stay within the white pixels. When complete, right-click and select Accept. Here is an example:
  3. The Total Points value is this example is 7. ENVI automatically defined 7 view points along the polygon, using the point spacing value of 100 that you specified.

  4. Select the NEONBoulderDSM.dat layer in the Layer Manager to make it active.
  5. Enter a value of 50 in the Zoom field in the ENVI toolbar. The display zooms out to 50%.
  6. Click the Select button in the ENVI toolbar.
  7. Enable the Preview option in the Viewshed Analysis panel.
  8. Move and expand the Preview Window so that you can see the full viewshed analysis result.
  9. You can increase the transparency of the Preview Window to see the DSM layer underneath. Use the Transparency slider in the ENVI toolbar as needed. This example shows 45% transparency:

The Any Source option was selected by default in the Visible From section of the Viewshed Analysis panel. Since you only defined one view source, the viewshed results are the same whether you select Any Source or All Sources.

  1. Select the All Points Within Sources option. This shows areas that are visible from all seven points within the view source.
  2. Select the Any Source option to prepare for the next step.

Export Viewshed Results to a Classification Image

  1. Disable the Preview option.
  2. Click Next in the Viewshed Analysis panel.
  3. In the Export panel, disable the Export Viewshed Vectors option.
  4. Under Export Viewshed Image, specify a location and filename for the output classification image.
  5. Click Finish.
  6. The resulting classification image displays over the DSM image. The Layer Manager shows two classes:
  7. Disable the red Not Visible layer. Here is an example of areas that are visible from the rooftop:
  8. When you are finished, exit ENVI.



© 2019 Harris Geospatial Solutions, Inc. |  Legal
My Account    |    Store    |    Contact Us