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
e = ENVI(/HEADLESS)
File = Filepath('qb_boulder_msi', Subdir=['data'], $
Root_Dir=e.Root_Dir)
Raster = e.OpenRaster(File)
Task = ENVITask('RasterProperties')
Task.INPUT_RASTER = Raster
Task.Execute
dataTypeName = Task.DATA_TYPE_NAME
dataTypeCode = Task.DATA_TYPE_CODE
nBands = Task.NBANDS
nColumns = Task.NCOLUMNS
nRows = Task.NROWS
spatialRef = Task.SPATIAL_REFERENCE
Print, dataTypeName
Print, dataTypeCode
Print nBands
Print, nColumns
Print, nRows
Print, spatialRef
Syntax
Result = ENVITask('RasterProperties')
Input parameters (Set, Get): INPUT_RASTER
Output parameters (Get only): DATA_TYPE_CODE, DATA_TYPE_NAME, NBANDS, NCOLUMNS, NROWS, SPATIAL_REFERENCE
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
INPUT_RASTER (required)
Specify a raster from which to retrieve properties.
Output Parameters
DATA_TYPE_CODE
An integer specifying the raster data type.
DATA_TYPE_NAME
A string specifying the raster data type.
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.
Methods
Execute
Parameter
ParameterNames
Properties
DESCRIPTION
DISPLAY_NAME
NAME
REVISION
TAGS
Version History
See Also
ENVITask