RasterProperties Task
This task retrieves the properties of an ENVIRaster. Although you can issue a PRINT command on an ENVIRaster to retrieve its properties, this task was designed for use within an image-processing script where you can create variables for the different properties.
Example
; Start the application
e = ENVI(/HEADLESS)
; Open an input file
File = Filepath('qb_boulder_msi', Subdir=['data'], $
Root_Dir=e.Root_Dir)
Raster = e.OpenRaster(File)
; Get the task from the catalog of ENVITasks
Task = ENVITask('RasterProperties')
; Define inputs
Task.INPUT_RASTER = Raster
; Run the task
Task.Execute
; Get outputs
dataTypeName = Task.DATA_TYPE_NAME
dataTypeCode = Task.DATA_TYPE_CODE
nBands = Task.NBANDS
nColumns = Task.NCOLUMNS
nRows = Task.NROWS
spatialRef = Task.SPATIAL_REFERENCE
; Print the values to the IDL console
Print, dataTypeName
Print, dataTypeCode
Print nBands
Print, nColumns
Print, nRows
Print, spatialRef
Syntax
Result = ENVITask('RasterProperties')
Input properties (Set, Get): INPUT_RASTER
Output properties (Get only): DATA_TYPE_CODE, DATA_TYPE_NAME, NBANDS, NCOLUMNS, NROWS, SPATIAL_REFERENCE
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:
DATA_TYPE_CODE
An integer specifying the raster data type.
DATA_TYPE_NAME
A string specifying the raster data type.
INPUT_RASTER (required)
Specify a raster from which to retrieve properties.
NBANDS
The number of bands in the raster.
NCOLUMNS
The number of columns in the raster.
NROWS
The number of rows in the raster.
SPATIAL_REFERENCE
The spatial reference of the raster; more specifically, the ENVIStandardRasterSpatialRef, ENVIPseudoRasterSpatialRef, or ENVIRPCRasterSpatialRef object associated with the raster.
Version History
ENVI 5.2. 1 |
Introduced |
API Version
4.2