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 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

ENVI 5.2.1

Introduced

See Also

ENVITask