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
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 = 'Mac Style'
ColorTask.Execute
DEMStretch = ENVIStretchParameters( $
STRETCH_TYPE='Linear', $
MIN_PERCENT=2.0, $
MAX_PERCENT=90.0)
TopoStretch = ENVIStretchParameters(STRETCH_TYPE='Gaussian')
Task = ENVITask('TopographicShadingUsingHLS')
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
Task.Execute
DataColl = e.Data
DataColl.Add, Task.OUTPUT_RASTER
View = e.GetView()
Layer = View.CreateLayer(Task.OUTPUT_RASTER)
Syntax
Result = ENVITask('TopographicShadingUsingHLS')
Input parameters (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 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 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 parameter 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_URI (optional)
Specify a string with the fully qualified filename and path of the associated OUTPUT_RASTER.
- If you do not specify this parameter, or set it to an exclamation symbol (!), ENVI creates a temporary file.
- If you set it to the hash symbol (#), ENVI creates a file in the temporary directory, but this file will not be deleted when ENVI closes.
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.
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
See Also
ENVITask, TopographicShadingUsingHSV Task, TopographicShadingUsingRGB Task, TopographicModeling Task, TopographicFeatures Task, GenerateContourLines Task, Masking Support in ENVITasks