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 properties (Set, Get): GRID_DEFINITION, INPUT_RASTERS, OUTPUT_RASTER_URI, RESAMPLING
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:
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.
OUTPUT_RASTER
This is a reference to the output raster of filetype ENVI.
OUTPUT_RASTER_URI (optional)
Specify a string with the fully qualified filename and path to export the associated OUTPUT_RASTER.
- If you set this property to an asterisk symbol (*), the output raster will be virtual and not written to disk.
- If you do not specify this property, or set it to an exclamation symbol (!), a temporary file will be created.
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.
Version History
API Version
4.2
See Also
ENVITask, ENVIGridDefinition, ENVILayerStackRaster, CalculateGridDefinitionFromRasterIntersection Task, CalculateGridDefinitionFromRasterUnion Task