ENVIRasterIterator::GetData

The GetData method returns the data for the current tile.

Example

In this example, we print the minimum and maximum tile values for the first, second, last, and second-to-last tiles in the raster.

; Launch the application

e = ENVI()

 

; Create an ENVIRaster

file = FILEPATH('qb_boulder_pan', ROOT_DIR=e.ROOT_DIR, $

SUBDIRECTORY = ['data'])

raster = e.OpenRaster(file)

 

; Get an iterator for the first band

tileIterator = raster.CreateTileIterator(BANDS=0)

 

; Print the min and max values for the first tile

tileIterator.Reset

PRINT, 'First Tile:'

PRINT, 'Min = ', MIN(tileIterator.Next())

PRINT, 'Max = ', MAX(tileIterator.GetData())

 

; Print the min and max values for the second tile

PRINT, 'Second Tile:'

PRINT, 'Min = ', MIN(tileIterator.Next())

PRINT, 'Max = ', MAX(tileIterator.GetData())

 

; Print the min and max values for the last tile

tileIterator.Reset, /LAST

PRINT, 'Last Tile:'

PRINT, 'Min = ', MIN(tileIterator.Previous())

PRINT, 'Max = ', MAX(tileIterator.GetData())

 

; Print the min and max values for the

; second-to-last tile

PRINT, 'Second-to-last Tile:'

PRINT, 'Min = ', MIN(tileIterator.Previous())

PRINT, 'Max = ', MAX(tileIterator.GetData())

Syntax

Result = ENVIRasterIterator.GetData([, Keywords=value])

Return Value

A two-dimensional array containing the data for the current tile.

Keywords

Keywords are applied only during the initial creation of the object.

ERROR

Set this keyword to a named variable that will contain any error message issued during execution of this routine. If no error occurs, the ERROR variable will be set to a null string (''). If an error occurs and the routine is a function, then the function result will be undefined.

When this keyword is not set and an error occurs, ENVI returns to the caller and execution halts. In this case, the error message is contained within !ERROR_STATE and can be caught using IDL's CATCH routine. See IDL Help for more information on !ERROR_STATE and CATCH.

See Manage Errors for more information on error handling in ENVI programming.

PIXEL_STATE

Set this keyword to a named variable that contains a byte array indicating the state of every pixel returned. The returned values are the sum of the bit values of the accumulated pixel states for every pixel returned.

PIXEL_STATE has three bits of information to determine if you want to use the corresponding pixel value in calculation:

The PIXEL_STATE value for a pixel could be any combination of the above bits:

See Raster Pixel State for more details.

Version History

ENVI 5

Introduced

ENVI 5.1

Added PIXEL_STATE keyword

API Version

4.2

See Also

ENVIRasterIterator, ENVIRaster::GetData