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 ENVIRasterViewshedTask.

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 properties (Set, Get): AZIMUTH, COMBINATION, HEIGHT, HORIZONTAL_FIELD_OF_VIEW, INPUT_RASTER, OUTPUT_RASTER_URI, PITCH, PIXEL_LOCATION, RANGE, VERTICAL_FIELD_OF_VIEW

Output properties (Get only):OUTPUT_RASTER

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

Methods

This task inherits the following methods from ENVITask:

AddParameter

Execute

Parameter

ParameterNames

RemoveParameter

Properties

This task inherits the following properties from ENVITask:

COMMUTE_ON_DOWNSAMPLE

COMMUTE_ON_SUBSET

DESCRIPTION

DISPLAY_NAME

NAME

REVISION

TAGS

This task also contains the following properties:

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 property). 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 property).

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 property).

INPUT_RASTER (required)

Specify an elevation raster to use for calculating the viewshed.

OUTPUT_RASTER

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

OUTPUT_RASTER_URI (optional)

Specify a string with the fully qualified filename and path of the associated OUTPUT_RASTER. If you do not specify this property, or set it to an exclamation symbol (!), a temporary file will be created.

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 property).

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 property).

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 property).

Version History

ENVI 5.2

Introduced

ENVI 5.3. 2

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

API Version

4.2

See Also

ENVITask