DiceRasterByDistance Task
This task separates a raster into tiles based on a specified distance. In most cases the tiles in the last row and column will be smaller than the specified distance, as the following example shows:
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)
; Get the task from the catalog of ENVITasks
Task = ENVITask('DiceRasterByDistance')
; Define inputs
Task.INPUT_RASTER = Raster
Task.TILE_DISTANCE = 1000.
Task.DISTANCE_UNITS = 'Meters'
Task.TILE_GRID_VECTORS = 'true'
; Define the output directory
Task.OUTPUT_DIRECTORY = Filepath('', /TMP)
; Run the task
Task.Execute
; Get the collection of data objects currently in the Data Manager
DataColl = e.Data
; Add the output to the Data Manager
DataColl.Add, Task.OUTPUT_RASTER
; Display the results
View1 = e.GetView()
FOR i=0,N_Elements(Task.Output_Raster)-1 DO $
Layer = View1.CreateLayer(Task.OUTPUT_RASTER[i])
vectorLayer = View1.CreateLayer(Task.OUTPUT_VECTOR)
View1.Zoom, /FULL_EXTENT
Syntax
Result = ENVITask('DiceRasterByDistance')
Input properties (Set, Get): DISTANCE_UNITS, INPUT_RASTER, OUTPUT_DIRECTORY, TILE_DISTANCE, TILE_GRID_VECTORS
Output properties (Get only): OUTPUT_RASTER, OUTPUT_VECTOR
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:
Properties
This task inherits the following properties from ENVITask:
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.
OUTPUT_DIRECTORY (optional)
Specify the output directory for the tiles. If set to an asterisk (*), the output rasters will be virtual. This will not be written to disk, and the directory will not be created. If you do not set this property, the tiles will save to the directory indicated by the ENVI Output Directory preference.
OUTPUT_RASTER
This property contains an array of output rasters. Their filenames contain the root name of the input raster with the row/column index appended in the form of RxCx. For example, R2C3 means row 2 and column 3.
OUTPUT_VECTOR
This property contains the output shapefile if you set the TILE_GRID_VECTORS property to true
.
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.
TILE_GRID_VECTORS (optional)
Set this property to true
to create an output shapefile that shows the tile boundaries.
Version History
ENVI 5.4 |
Introduced |
ENVI 5.5 |
OUTPUT_DIRECTORY now supports '*', which allows OUTPUT_RASTER to be virtual output. |
API Version
4.2
See Also
ENVITask, ENVITask::Parameter, ENVISubsetRaster, CreateSubrectsFromDistance Task, CreateSubrectsFromPixels Task, CreateSubrectsFromTileCount Task, CreateSubrectsFromVector Task, DiceRasterByPixel Task, DiceRasterBySubrects Task, DiceRasterByTileCountTask, DiceRasterByVector Task, ExportRastersToDirectory Task