TopographicShadingUsingRGB Task
This task blends an RGB (red/green/blue) 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 = 'Hue Sat Lightness 2'
ColorTask.Execute
; Set the DEM stretch parameters
DEMStretch = ENVIStretchParameters( $
STRETCH_TYPE='Square Root', $
MIN_VALUE=1241, $
MAX_VALUE=1503)
; Set the topographic stretch parameters
TopoStretch = ENVIStretchParameters( $
STRETCH_TYPE='Linear', $
MIN_VALUE=0.73, $
MAX_VALUE=0.88)
; Get the topographic shading task from the catalog of ENVITasks
Task = ENVITask('TopographicShadingUsingRGB')
; 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.BLEND_PERCENT = 60
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('TopographicShadingUsingRGB')
Input properties (Set, Get): AZIMUTH, BLEND_PERCENT, DEM_COLOR_TABLE, DEM_STRETCH, ELEVATION, INPUT_RASTER, 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:
Properties
This task inherits the following properties from ENVITask:
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.
BLEND_PERCENT (optional)
Specify the percentage of blending between the input raster and topographic feature. The default value is 50.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.
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, TopographicShadingUsingHLS Task, TopographicShadingUsingHSV Task, TopographicModeling Task, TopographicFeatures Task, GenerateContourLines Task