This task returns a grid definition from an array of rasters whose spatial extent encompasses all of the rasters.
The output grid definition can be used as input to tasks such as BuildLayerStack, RegridRaster, and RegridRasterSeries.
Example
This example creates a grid definition that is based on the geometric union of two different spatial grids. The images in the two grids are available from our ENVI Tutorials web page. Click the API Gridding Examples link to download the .zip file to your machine, then unzip the files. Update the file references in the example with the correct locations.
Since the first input raster is in a UTM Zone 54 coordinate system, that will be the coordinate system of the output grid definition.
e = ENVI()
File1 = 'MODIS_LST_2009-03-07.dat'
MODISRaster = e.OpenRaster(File1)
File2 = 'VIIRSLST2014-03-07.dat'
VIIRSRaster = e.OpenRaster(File2)
Task = ENVITask('CalculateGridDefinitionFromRasterUnion')
Task.INPUT_RASTERS = [MODISRaster, VIIRSRaster]
Task.Execute
LayerTask = ENVITask('BuildLayerStack')
LayerTask.INPUT_RASTERS = [MODISRaster, VIIRSRaster]
LayerTask.GRID_DEFINITION = Task.OUTPUT_GRIDDEFINITION
LayerTask.Execute
DataColl = e.Data
DataColl.Add, LayerTask.OUTPUT_RASTER
View = e.GetView()
Layer = View.CreateLayer(LayerTask.OUTPUT_RASTER)
Print, Task.OUTPUT_GRIDDEFINITION
Syntax
Result = ENVITask('CalculateGridDefinitionFromRasterUnion')
Input parameters (Set, Get): INPUT_RASTERS, PIXEL_SIZE
Output parameters (Get only): OUTPUT_GRIDDEFINITION
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
INPUT_RASTERS (required)
Specify an array of rasters from which to calculate the grid definition. The first raster will determine the coordinate system and pixel size of the grid definition, unless they are later modified.
PIXEL_SIZE (optional)
Specify a two-element array with the [x,y] pixel size of the output grid definition.
Output Parameters
OUTPUT_GRIDDEFINITION
This is a reference to the output ENVIGridDefinition.
Methods
Execute
Parameter
ParameterNames
Properties
DESCRIPTION
DISPLAY_NAME
NAME
REVISION
TAGS
Version History
See Also
ENVITask, CalculateGridDefinitionFromRasterIntersection Task, BuildGridDefinitionFromRaster Task, BuildLayerStack Task, ENVIGridDefinition, ENVIGridDefinition::Union, ENVISpatialGridRaster, RegridRasterSeriesByUnion Task