This task blends an HLS (hue/lightness/saturation) color representation of a digital elevation model (DEM) with a topographic feature (typically, shaded relief). The result is a color image that provides a better visual appearance of the shape and texture of topographic features than using the DEM alone.

Example


; Start the application
e = ENVI()
 
; Open an input file
File = Filepath('bhdemsub.img', $
  Subdir=['classic', 'data'], $
  Root_Dir=e.Root_Dir)
Raster = e.OpenRaster(File)
 
; Run the GetColorTable task
ColorTask = ENVITask('GetColorTable')
ColorTask.COLOR_TABLE_NAME = 'Mac Style'
ColorTask.Execute
 
; Set the DEM stretch parameters
DEMStretch = ENVIStretchParameters( $
  STRETCH_TYPE='Linear', $
  MIN_PERCENT=2.0, $
  MAX_PERCENT=90.0)
 
; Set the topographic stretch parameters
TopoStretch = ENVIStretchParameters(STRETCH_TYPE='Gaussian')
 
; Get the topographic shading task from the catalog of ENVITasks
Task = ENVITask('TopographicShadingUsingHLS')
 
; Define inputs
Task.INPUT_RASTER = Raster
Task.DEM_STRETCH = DEMStretch
Task.DEM_COLOR_TABLE = ColorTask.OUTPUT_COLOR_TABLE
Task.TOPOGRAPHIC_PRODUCT = 'Shaded Relief'
Task.TOPOGRAPHIC_STRETCH = TopoStretch
Task.KERNEL_SIZE = 5
 
; 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
View = e.GetView()
Layer = View.CreateLayer(Task.OUTPUT_RASTER)

Syntax


Result = ENVITask('TopographicShadingUsingHLS')

Input properties (Set, Get): AZIMUTH, DEM_COLOR_TABLE, DEM_STRETCH, ELEVATION, INPUT_RASTER, INVERT_LIGHTNESS, INVERT_SATURATION, KERNEL_SIZE, OUTPUT_RASTER_URI, TOPOGRAPHIC_PRODUCT, TOPOGRAPHIC_STRETCH

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 azimuth angle of the model in degrees. The value will only be used for the Shaded Relief product. The default value is 45.0.

DEM_COLOR_TABLE (required)

Specify a color table to apply to the input raster. This property only acccepts a [*, 3] array of color table values. To use a predefined color table, you can run the GetColorTable task, then pass the resulting array to DEM_COLOR_TABLE.

DEM_STRETCH (required)

Specify an ENVIStretchParameters object with the stretch to apply to the input raster before applying a color table.

ELEVATION (optional)

Specify the elevation angle of the model in degrees. The value will only be used for the Shaded Relief product. The default value is 45.0.

INPUT_RASTER (required)

Specify a raster on which to perform topographic shading; for example, a DEM, gridded bathymetry data, or gridded magnetic anomaly data.

INVERT_LIGHTNESS (optional)

Set to true if you want to invert the lightness band during color blending.

INVERT_SATURATION (optional)

Set to true if you want to invert the saturation band during color blending.

KERNEL_SIZE (optional)

Specify the size of the kernel used for topographic processing. The default value is 3.

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.

TOPOGRAPHIC_PRODUCT (optional)

Specify a string with the topographic product to calculate. The choices are as follows:

  • Slope
  • Aspect
  • Shaded Relief (default)
  • Profile Convexity
  • Plan Convexity
  • Longitudinal Convexity
  • Cross Sectional Convexity
  • Minimum Curvature
  • Maximum Curvature
  • RMS
  • Slope Percent

See Background for descriptions of the options.

TOPOGRAPHIC_STRETCH (required)

Specify an ENVIStretchParameters object with the stretch to apply to the selected topographic product before blending.

Version History


ENVI 5.5. 1

Introduced

API Version


4.2

See Also


ENVITask, TopographicShadingUsingHSV Task, TopographicShadingUsingRGB Task, TopographicModeling Task, TopographicFeatures Task, GenerateContourLines Task