This task creates a 2D array of subrects based on the specified number of tiles. A subrect is a bounding box used to spatially subset a raster. It is part of a sequence for dicing rasters:
Consider using ENVIDiceRasterByTileCount to perform these steps in one task.
Example
e = ENVI()
File = Filepath('qb_boulder_msi', Subdir=['data'], $
Root_Dir=e.Root_Dir)
Raster = e.OpenRaster(File)
Task = ENVITask('CreateSubrectsFromTileCount')
Task.NUMBER_OF_X_TILES = 3
Task.NUMBER_OF_Y_TILES = 4
Task.NCOLUMNS = Raster.NCOLUMNS
Task.NROWS = Raster.NROWS
Task.Execute
Subrects = Task.SUBRECTS
SubNames = Task.SUBRECT_NAMES
Help, Subrects
IDL prints:
SUBRECTS LONG =Array[4, 12]
This shows that 12 subrects were created with four coordinate points each. Now pass the subrects to the DiceRasterBySubrects task:
DiceTask = ENVITask('DiceRasterBySubrects')
DiceTask.INPUT_RASTER = Raster
DiceTask.SUBRECT_ARRAY = Subrects
DiceTask.SUBRECT_NAMES = SubNames
DiceTask.Execute
ExportTask = ENVITask('ExportRastersToDirectory')
ExportTask.INPUT_RASTER = DiceTask.OUTPUT_RASTER
ExportTask.OUTPUT_DIRECTORY = Filepath('', /TMP)
ExportTask.Execute
Syntax
Result = ENVITask('CreateSubrectsFromTileCount')
Input properties (Set, Get): NCOLUMNS, NROWS, NUMBER_OF_X_TILES, NUMBER_OF_Y_TILES
Output properties (Get only): SUBRECTS, SUBRECT_NAMES
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:
NCOLUMNS (required)
Specify the number of columns in the raster.
NROWS (required)
Specify the number of rows in the raster.
NUMBER_OF_X_TILES (required)
Specify the number of resulting tiles in the X direction.
NUMBER_OF_Y_TILES (required)
Specify the number of resulting tiles in the Y direction.
SUBRECTS
This property contains an array of output subrects.
SUBRECT_NAMES
This property contains the names of each output subrect.
Version History
API Version
4.3
See Also
ENVITask, ENVITask::Parameter, ENVISubsetRaster, CreateSubrectsFromDistance Task, CreateSubrectsFromPixels Task, CreateSubrectsFromROI Task, CreateSubrectsFromVector Task, DiceRasterByDistance Task, DiceRasterByPixel Task, DiceRasterBySubrects Task, DiceRasterByTileCount Task, DiceRasterByVector Task, ExportRastersToDirectory Task