>  Docs Center  >  ENVI API  >  ENVICalculateGridDefinitionFromRasterIntersectionTask
ENVI

ENVICalculateGridDefinitionFromRasterIntersectionTask

ENVICalculateGridDefinitionFromRasterIntersectionTask

This task returns a grid definition from an array of rasters whose spatial extent encompasses the area where the rasters overlap.

The output grid definition can be used as input to tasks such as ENVIBuildLayerStackTask, ENVIRegridRasterTask, and ENVIRegridRasterSeriesTask.

Example


This example creates a new grid definition that is based on the geometric intersection of two different images. The images are available on the ENVI Resource DVD (in the APIGriddingExamples folder) or from the ENVI Tutorials web page. Click the "ENVI Tutorial Data" hyperlink. Copy the images to your local drive.

  • MODIS Land Surface Temperature (MOD11_L2) swath image from 07 March 2009, georeferenced to a UTM Zone 54 coordinate system using ENVI's Georeference MODIS tool, corrected for bowtie artifacts, spatially subsetted, and scaled by 0.02 so that the pixel values are in Kelvins.
  • Suomi NPP VIIRS Land Surface Temperature EDR image from 07 March 2014, georeferenced to a Geographic Lat/Lon (WGS-84) coordinate system, and spatially subsetted.

Since the first input raster is in a UTM Zone 54 coordinate system, that will be the coordinate system of the output grid definition.

; Start the application
e = ENVI()
 
; Open the MODIS LST raster
File1 =  'MODIS_LST_2009-03-07.dat'
MODISRaster = e.OpenRaster(File1)
 
; Open the Suomi NPP VIIRS LST raster
File2 = 'VIIRSLST2014-03-07.dat'
VIIRSRaster = e.OpenRaster(File2)
 
; Get the task from the catalog of ENVITasks
Task = ENVITask('CalculateGridDefinitionFromRasterIntersection')
 
; Define inputs
Task.INPUT_RASTERS = [MODISRaster, VIIRSRaster]
 
; Run the task
Task.Execute
 
; Create a layer Stack
LayerTask = ENVITask('BuildLayerStack')
LayerTask.INPUT_RASTERS = [MODISRaster, VIIRSRaster]
LayerTask.GRID_DEFINITION = Task.OUTPUT_GRIDDEFINITION
LayerTask.Execute
 
; Get the collection of data objects currently available in the Data Manager
DataColl = e.Data
 
; Add the output to the Data Manager
DataColl.Add, LayerTask.OUTPUT_RASTER
 
; Display the result
View = e.GetView()
Layer = View.CreateLayer(LayerTask.OUTPUT_RASTER)
 
; Print the properties of the grid definition
Print, Task.OUTPUT_GRIDDEFINITION

Syntax


Result = ENVITask('CalculateGridDefinitionFromRasterIntersection')

Input properties (Set, Get): INPUT_RASTERS, PIXEL_SIZE

Output properties (Get only): OUTPUT_GRIDDEFINITION

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:

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.

OUTPUT_GRIDDEFINITION

This is a reference to the output ENVIGridDefinition.

PIXEL_SIZE (optional)

Specify a two-element array with the [x,y] pixel size of the output grid definition.

Version History


ENVI 5.5, Service Pack 2

Introduced

API Version


3.3

See Also


ENVITask, ENVITask::Parameter, ENVICalculateGridDefinitionFromRasterUnionTask, ENVIBuildGridDefinitionFromRasterTask, ENVIBuildLayerStackTask, ENVIGridDefinition, ENVIGridDefinition::Intersection, ENVISpatialGridRaster, ENVIRegridRasterSeriesByIntersectionTask



© 2019 Harris Geospatial Solutions, Inc. |  Legal
My Account    |    Store    |    Contact Us