RasterViewshed Task

This task calculates a viewshed analysis, which is the process of identifying locations that are visible from one or more view points. These view (or observer) points are often constrained by variables such as height, horizontal and vertical field of view (FOV), azimuth, and pitch. To properly model a restricted viewshed analysis, you need to take into account these view constraints.

To determine more than one single viewshed, run this task multiple times with different single-view pixel locations.

To create a classification vector file of the results, run the ClassificationToShapefile task on the output raster of this task.

ENVI uses the Izraelevitz (2003) algorithm for viewshed analysis, which is an extension to the original Xdraw algorithm developed by Franklin et al. (1994). The Izraelevitz algorithm performs well in densely sampled terrain elevation models, and it is significantly faster than the radial interpolation method used in previous versions of ENVI.

References:

Franklin, W.R., C.K. Ray, and S. Mehta. Geometric Algorithms for Siting of Air Defense Missile Batteries, Technical Report DAAL03-86-D-0001 (1994), Battelle, Columbus Division, Columbus, OH, 129 p.

Izraelevitz, D. "A Fast Algorithm for Approximate Viewshed Computation." Photogrammetric Engineering & Remote Sensing 69, No. 7 (2003): 767-774.

Example

; Start the application

e = ENVI()

 

; Open an input file

DEMfile = Filepath('GMTED2010.jp2', Subdir=['data'], $

  Root_Dir=e.Root_Dir)

Raster = e.OpenRaster(DEMfile)

 

; Create a spatial subset of the Alps mountain range

AlpsSubset = ENVISubsetRaster(raster, $

  SUB_RECT=[22200, 4374, 22700, 4874])

 

; Export the subset to disk, then reopen it

outFile = e.GetTemporaryFilename()

AlpsSubset.Export, outFile, 'ENVI'

newRaster = e.OpenRaster(outFile)

 

; Display the subset

View = e.GetView()

Layer = View.CreateLayer(AlpsSubset)

 

; Get the viewshed task from the catalog of ENVITasks

Task = ENVITask('RasterViewshed')

 

; Define inputs

Task.INPUT_RASTER = AlpsSubset

Task.AZIMUTH = 135.0

Task.HEIGHT = 500.0

Task.HORIZONTAL_FIELD_OF_VIEW = 120.0

Task.PITCH = 10.0

Task.PIXEL_LOCATION = [100, 250]

Task.RANGE = 50000.0

Task.VERTICAL_FIELD_OF_VIEW = 60.0

 

; Run the task

Task.Execute

 

; Get the collection of data objects currently available in the Data Manager

DataColl = e.Data

 

; Add the output to the Data Manager

DataColl.Add, Task.OUTPUT_RASTER

 

; Display the result

viewshedLayer = View.CreateLayer(Task.OUTPUT_RASTER)

View.Zoom, /FULL_EXTENT

Syntax

Result = ENVITask('RasterViewshed')

Input parameters (Set, Get): AZIMUTH, COMBINATION, HEIGHT, HORIZONTAL_FIELD_OF_VIEW, INPUT_RASTER, OUTPUT_RASTER_URI, PITCH, PIXEL_LOCATION, RANGE, VERTICAL_FIELD_OF_VIEW

Output parameters (Get only):OUTPUT_RASTER

Parameters marked as "Set" are those that you can set to specific values. You can also retrieve their current values any time. Parameters marked as "Get" are those whose values you can retrieve but not set.

Input Parameters

AZIMUTH (optional)

Specify the angle in degrees clockwise from North from the observer point. Values range from 0 to 360. Specify an array of values if using multiple view points (specified with the PIXEL_LOCATION parameter). The number of array elements must match the number of view points.

COMBINATION (optional)

Specify one of the following string values indicating how multiple viewsheds should be combined.

HEIGHT (required)

Specify the view height in meters above the surface. Or specify an array of values if using multiple view points (specified with the PIXEL_LOCATION parameter).

HORIZONTAL_FIELD_OF_VIEW (optional)

Specify the angle in degrees of the horizontal range of the observer point. Values range from 0 to 360. Specify an array of values if using multiple view points (specified with the PIXEL_LOCATION parameter).

INPUT_RASTER (required)

Specify an elevation raster to use for calculating the viewshed.

OUTPUT_RASTER_URI (optional)

Specify a string with the fully qualified filename and path of the associated OUTPUT_RASTER.

PITCH (optional)

Specify the verticle pointing angle (in degrees) of the observer point's line of sight. A positive pitch value is above the horizon, and a negative pitch value is below the horizon. Values range from -90 to 90. Specify an array of values if using multiple view points (specified with the PIXEL_LOCATION parameter).

PIXEL_LOCATION (required)

For a single view point, specify a two-element integer array with the column and row location in the elevation raster.

For multiple view points, specify a 2D array as follows, where n is the number of view points:

[[column_1, column_2,...column_n], [row_1, row_2,...row_n]]

RANGE (required)

Specify a range at least three times the pixel size (in meters), out to which a viewshed will be calculated.
Specify an array of values if using multiple view points (specified with the PIXEL_LOCATION parameter).

VERTICAL_FIELD_OF_VIEW (optional)

Specify the angle in degrees of the vertical range of the observer point. Values range from 0 to 180. Specify an array of values if using multiple view points (specified with the PIXEL_LOCATION parameter).

Output Parameters

OUTPUT_RASTER

This is a reference to the output raster of filetype ENVI.

Methods

Execute

Parameter

ParameterNames

Properties

DESCRIPTION

DISPLAY_NAME

NAME

REVISION

TAGS

Version History

ENVI 5.2

Introduced

ENVI 5.3. 2

Added the following parameters: AZIMUTH, HORIZONTAL_FIELD_OF_VIEW, PITCH, and VERTICAL_FIELD_OF_VIEW

See Also

ENVITask, ClassificationToShapefile Task,