BuildMetaspatialRaster Task

This task constructs an ENVIRaster from an array of non-overlapping and non-gapping source rasters that have the same spatial dimensions. The individual rasters are tiled into one virtual raster.

If source rasters need to be cropped or padded to fit into a standard tile size, use ENVIBuildIrregularGridMetaspatialRasterTask instead.

The virtual raster associated with this task is ENVIMetaspatialRaster.

Example

This example creates a metaspatial raster from four source rasters. The source files 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.

; Start the application

e = ENVI()

 

; Select input files.

ULFile = 'qb_boulder_msi_UpperLeft.dat'

ULRaster = e.OpenRaster(ULFile)

 

URFile = 'qb_boulder_msi_UpperRight.dat'

URRaster = e.OpenRaster(URFile)

 

LLFile = 'qb_boulder_msi_LowerLeft.dat'

LLRaster = e.OpenRaster(LLFile)

 

LRFile = 'qb_boulder_msi_LowerRight.dat'

LRRaster = e.OpenRaster(LRFile)

 

SourceRasters = [[ULRaster, URRaster], [LLRaster, LRRaster]]

 

; Get the task from the catalog of ENVITasks

Task = ENVITask('BuildMetaspatialRaster')

 

; Define inputs

Task.INPUT_RASTERS = SourceRasters

 

; Run the task

Task.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, Task.OUTPUT_RASTER

 

; Display the result

View = e.GetView()

Layer = View.CreateLayer(Task.OUTPUT_RASTER)

View1.Zoom, /FULL_EXTENT

Syntax

Result = ENVITask('BuildMetaspatialRaster')

Input properties (Set, Get): DATA_IGNORE_VALUE, INPUT_RASTERS, OUTPUT_RASTER_URI, SPATIAL_REFERENCE

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:

DATA_IGNORE_VALUE (optional)

Specify a unique data value for pixels in the output raster that have a non-zero pixel state value. Pixels from empty tiles will have a non-zero pixel state value.

INPUT_RASTERS (required)

Specify a 2D array of input ENVIRasters. The following rules apply:

SourceRasters = [raster1, raster2, raster3, raster4]

 

SourceRasters = [[raster1, raster2], [raster3, raster4]]

 

[[raster1], [raster2], [raster3], [raster4]]

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.

SPATIAL_REFERENCE (optional)

Set this parameter to an ENVIStandardRasterSpatialRef, ENVIPseudoRasterSpatialRef, or ENVIRPCRasterSpatialRef object to be used by OUTPUT_RASTER. If this is not specified, then the SPATIALREF property of the first raster in the INPUT_RASTERS array will be used, if possible. If that raster is a NullObject, or if it does not have a SPATIALREF value, then OUTPUT_RASTER will not have any spatial reference associated with it.

Version History

ENVI 5.2. 1

Introduced

ENVI 5.5

OUTPUT_RASTER_URI now supports '*', which allows OUTPUT_RASTER to be virtual output.

INPUT_RASTERS allows NullObject values in array of ENVIRasters.

Add DATA_IGNORE_VALUE, so that exported raster will have correct pixel state.

API Version

4.2

See Also

ENVITask, ENVISubsetRaster, ENVIMetaspatialRaster, ENVIIrregularGridMetaspatialRaster, BuildIrregularGridMetaspatialRaster Task