This task creates an array of rasters based on subrects. A subrect is a bounding box used to spatially subset a raster. It is part of a sequence for dicing rasters:

Consider using one of the following to perform these steps in one task:

Example


; Start the application
e = ENVI()
 
; Open an input file
File = Filepath('qb_boulder_msi', Subdir=['data'], $
  Root_Dir=e.Root_Dir)
Raster = e.OpenRaster(File)
 
; Create some subrects
SubrectTask = ENVITask('CreateSubrectsFromTileCount')
 
; Define inputs
SubrectTask.NUMBER_OF_X_TILES = 3
SubrectTask.NUMBER_OF_Y_TILES = 4
SubrectTask.NCOLUMNS = Raster.NCOLUMNS
SubrectTask.NROWS = Raster.NROWS
 
; Run the task
SubrectTask.Execute
 
; Get the resulting subrects
Subrects = SubrectTask.SUBRECTS
 
; Get a list of names that will be used to denote the subrect areas
SubNames = SubrectTask.SUBRECT_NAMES
 
; Get the primary task from the catalog of ENVITasks
Task = ENVITask('DiceRasterBySubrects')
 
; Define inputs
Task.INPUT_RASTER = Raster
Task.SUBRECT_ARRAY = Subrects
Task.SUBRECT_NAMES = SubNames
 
; Run the task
Task.Execute
 
; Get the data collection
DataColl = e.Data
 
; Add the output to the data collection
DataColl.Add, Task.Output_Raster
 
; Display the result
View1 = e.GetView()
for i=0,N_Elements(Task.Output_Raster)-1 do $
  Layer = View1.CreateLayer(Task.Output_Raster[i])
View1.Zoom, /FULL_EXTENT

Syntax


Result = ENVITask('DiceRasterBySubrects')

Input properties (Set, Get): INPUT_RASTER, SUBRECT_ARRAY, SUBRECT_NAMES

Output properties (Get only):OUTPUT_RASTER

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:

AddParameter

Execute

Parameter

ParameterNames

RemoveParameter

Properties


This task inherits the following properties from ENVITask:

COMMUTE_ON_DOWNSAMPLE

COMMUTE_ON_SUBSET

DESCRIPTION

DISPLAY_NAME

NAME

REVISION

TAGS

This task also contains the following properties:

INPUT_RASTER (required)

Specify the input raster.

OUTPUT_RASTER

This property contains an array of output rasters.

SUBRECT_ARRAY (required)

Specify a (4,n) array with subrects in [x1,y1,x2,y2] format.

SUBRECT_NAMES (optional)

Specify a string array for the names to be appended for each subrect.

Version History


ENVI 5.4

Introduced

API Version


4.2

See Also


ENVITask, ENVITask::Parameter, ENVISubsetRaster, CreateSubrectsFromDistance Task, CreateSubrectsFromPixels Task, CreateSubrectsFromTileCount Task, CreateSubrectsFromVector Task, DiceRasterByDistance Task, DiceRasterByPixel Task, DiceRasterByTileCount Task, DiceRasterByVector Task, ExportRastersToDirectory Task