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
e = ENVI()
File = Filepath('bhdemsub.img', $
Subdir=['classic', 'data'], $
Root_Dir=e.Root_Dir)
Raster = e.OpenRaster(File)
ColorTask = ENVITask('GetColorTable')
ColorTask.COLOR_TABLE_NAME = 'Hue Sat Lightness 2'
ColorTask.Execute
DEMStretch = ENVIStretchParameters( $
STRETCH_TYPE='Square Root', $
MIN_VALUE=1241, $
MAX_VALUE=1503)
TopoStretch = ENVIStretchParameters( $
STRETCH_TYPE='Linear', $
MIN_VALUE=0.73, $
MAX_VALUE=0.88)
Task = ENVITask('TopographicShadingUsingRGB')
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
Task.Execute
DataColl = e.Data
DataColl.Add, Task.OUTPUT_RASTER
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:
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.
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
API Version
4.3
See Also
ENVITask, TopographicShadingUsingHLS Task, TopographicShadingUsingHSV Task, TopographicModeling Task, TopographicFeatures Task, GenerateContourLines Task