This task creates a 2D array of subrects based on a specified distance. A subrect is a bounding box used to spatially subset a raster. It is part of a sequence for dicing rasters:
Consider using ENVIDiceRasterByDistance 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('CreateSubrectsFromDistance')
Task.TILE_DISTANCE = 1000
Task.DISTANCE_UNITS = 'Meters'
Task.INPUT_RASTER = Raster
Task.Execute
Subrects = Task.SUBRECTS
SubNames = Task.SUBRECT_NAMES
Help, Subrects
IDL prints:
SUBRECTS LONG =Array[4, 9]
This shows that nine 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('CreateSubrectsFromDistance')
Input properties (Set, Get): DISTANCE_UNITS, INPUT_RASTER, TILE_DISTANCE
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:
DISTANCE_UNITS (required)
Specify a string indicating the units of the tile distance. The options are:
- Meters
- Km
- Feet
- US Survey Feet
- Yards
- Miles
- Nautical Miles
INPUT_RASTER (required)
Specify the input raster. It must have an ENVIStandardRasterSpatialRef, ENVIRPCRasterSpatialRef, or ENVIPseudoRasterSpatialRef spatial reference defined.
SUBRECTS
This property contains an array of output subrects.
SUBRECT_NAMES
This property contains the names of each output subrect.
TILE_DISTANCE (required)
Specify a double-precision value indicating the distance by which tiles are created, in the units specified by DISTANCE_UNITS. This value applies to both the X and Y direction.
Version History
API Version
4.3
See Also
ENVITask, ENVITask::Parameter, ENVISubsetRaster, CreateSubrectsFromPixels Task, CreateSubrectsFromROI Task, CreateSubrectsFromTileCount Task, CreateSubrectsFromVector Task, DiceRasterByDistance Task, DiceRasterByPixel Task, DiceRasterBySubrects Task, DiceRasterByTileCount Task, DiceRasterByVector Task, ExportRastersToDirectory Task