ENVIRaster::SetTile

This method sets the current tile with new data in conjunction with the ENVIRasterIterator object.

In order for ENVI to process images that are much larger than the total amount of system RAM available, large images are broken into pieces (tiles) that are small enough for the system to handle. When the image is processed, only one tile is read into memory at a time.

Example

For the following example:

  1. Copy and paste the procedure into an IDL editor window.
  2. Save the file as enviraster_settile_example.pro.
  3. Compile and run the procedure.

PRO enviraster_settile_example

COMPILE_OPT IDL2

  ; start the application

  e = ENVI()

   

  ; open a raster

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

    SUBDIRECTORY = ['data'])

  raster = e.OpenRaster(file)

   

  ; Create an output raster

  newFile = e.GetTemporaryFilename()

  rasterNew = ENVIRaster(URI=newFile, INHERITS_FROM=raster)

   

  ; Iterate through the tiles of the original data set

  tiles = raster.CreateTileIterator()

  FOREACH tile, Tiles DO BEGIN

    data = EMBOSS(tile, /EDGE_WRAP)

    rasterNew.SetTile, Data, Tiles

  ENDFOREACH

   

  ; Save the data and display

  rasterNew.Save

  view = e.GetView()

  layer = view.CreateLayer(rasterNew)

END

Syntax

ENVIRaster.SetTile, Data, Iterator [, ERROR=variable]

Arguments

Data

A 2D array of data to be written to the ENVIRaster, of the form [ncolumns, nbands] or [ncolumns, nrows], depending on the interleave of the ENVIRaster. The data dimensions must match those of the tile currently active in the iterator.

Iterator

A reference to an ENVIRasterIterator.

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.

Version History

ENVI 5

Introduced

API Version

4.2

See Also

ENVIRaster, ENVIRaster::CreateTileIterator, ENVIRaster::SetData