This task builds a layer-stacked raster from a set of rasters that will be reprojected and regridded to a common spatial grid. The input rasters do not need to have the same number of columns and rows.
This is different than using the BuildBandStack task, where the input rasters must have the same number of columns and rows and no reprojection or regridding will occur.
The virtual raster associated with this task is ENVILayerStackRaster.
Example
e = ENVI()
file = 'S2A_OPER_MTD...xml'
raster = e.OpenRaster(file)
bands10m = raster[0]
bands20m = raster[1]
gridTask = ENVITask('BuildGridDefinitionFromRaster')
gridTask.INPUT_RASTER = bands10m
gridTask.Execute
Task = ENVITask('BuildLayerStack')
Task.INPUT_RASTERS = [bands10m, bands20m]
Task.GRID_DEFINITION = gridTask.OUTPUT_GRIDDEFINITION
Task.Execute
e.Data.Add, Task.OUTPUT_RASTER
View = e.GetView()
Layer = View.CreateLayer(Task.OUTPUT_RASTER)
Syntax
Result = ENVITask('BuildLayerStack')
Input parameters (Set, Get): GRID_DEFINITION, INPUT_RASTERS, ORDER_BANDS_BY_WAVELENGTH, OUTPUT_RASTER_URI, RESAMPLING
Output parameters (Get only): OUTPUT_RASTER
Parameters marked as "Set" are those that you can set to specific values. You can also retrieve their current values any time. Parameters marked as "Get" are those whose values you can retrieve but not set.
Input Parameters
GRID_DEFINITION (optional)
Specify an ENVIGridDefinition object that defines the pixel size, rows and columns, and coordinate system of the desired spatial reference. If this is not set, then an ENVIGridDefinition will be constructed from the first raster in INPUT_RASTERS.
INPUT_RASTERS (required)
Specify an array of rasters from which to build a layer-stacked raster.
ORDER_BANDS_BY_WAVELENGTH (optional)
Set if bands should be ordered by increasing wavelength value. This parameter is ignored if the rasters do not have wavelength metadata.
OUTPUT_RASTER_URI (optional)
Specify a string with the fully qualified filename and path to export the associated OUTPUT_RASTER.
- If you set this parameter to an asterisk symbol (*), the output raster will be virtual and not written to disk.
- If you do not specify this parameter, or set it to an exclamation symbol (!), a temporary file will be created.
- If you set it to the hash symbol (#), ENVI creates a file in the temporary directory, but this file will not be deleted when ENVI closes.
RESAMPLING (optional)
Specify the resampling method to use when creating the spatial grid:
- Nearest Neighbor (default): Uses the nearest pixel without any interpolation.
- Bilinear: Performs a linear interpolation using four pixels to resample.
- Cubic Convolution: Uses 16 pixels to approximate the sinc function using cubic polynomials to resample the image.
Output Parameters
OUTPUT_RASTER
This is a reference to the output raster of filetype ENVI.
Methods
Execute
Parameter
ParameterNames
Properties
DESCRIPTION
DISPLAY_NAME
NAME
REVISION
TAGS
Version History
ENVI 5.5 |
Introduced |
ENVI 6.1 |
Added ORDER_BANDS_BY_WAVELENGTH parameter
|
See Also
ENVITask, ENVIGridDefinition, ENVILayerStackRaster, CalculateGridDefinitionFromRasterIntersection Task, CalculateGridDefinitionFromRasterUnion Task, Masking Support in ENVITasks