Welcome to the Harris Geospatial product documentation center. Here you will find reference guides, help documents, and product libraries.

Harris Geospatial / Docs Center / ENVI API / Processing / BuildMetaspatialRaster



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.


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

; 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
; Define outputs
Task.OUTPUT_RASTER_URI = e.GetTemporaryFilename()
; Run the task
; 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
View1 = e.GetView()
Layer1 = View1.CreateLayer(Task.Output_Raster)
View1.Zoom, /FULL_EXTENT


Result = ENVITask('BuildMetaspatialRaster')


Output properties (Get only): DESCRIPTION, NAME, 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.


This task inherits the following methods from ENVITask:








This property describes the task.


This property is now deprecated and has no effect on task behavior. All task property values are validated when they are set, and they throw an error with bad input.

INPUT_RASTERS (required)

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

  • Source rasters must have the same number of bands and the same spatial dimensions. One exception is that the outside edges can be shorter than the rest as long as all rasters in the entire row or column are equal in size.
  • Specify empty tiles with null objects by calling the IDL Obj_New routine instead of using ENVIRasters.
  • Padded and empty tiles will have PIXEL_STATE set to 2 (No Data). The pixel data will be invalid in these areas. If you need to export the raster to disk, provide a data ignore value.
  • Metadata values are passed from the source rasters to the virtual raster only if the values are the same in all source rasters.
  • Source rasters do not need to be georeferenced. If the top-left tile contains a spatial reference, that reference will be used for the virtual raster. You can override the spatial reference by using the SPATIALREF property.
  • The order of the array elements determines the layout of the tiles in the metaspatial raster. Here are some examples:
SourceRasters = [raster1, raster2, raster3, raster4]


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


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


This property contains the name of the task.


This is a reference to the output raster of filetype ENVI.


Specify a string with the fully qualified filename and path of the output raster. If you do not specify this property, the output raster is only temporary. Once the raster has no remaining references, ENVI deletes the temporary file.


Specify the spatial reference that will be applied to the resulting metaspatial raster.

Version History

ENVI 5.2, Service Pack 1


API Version


See Also

ENVITask, ENVITask::Parameter, ENVISubsetRaster, ENVIMetaspatialRaster, ENVIIrregularGridMetaspatialRaster, ENVIBuildIrregularGridMetaspatialRasterTask

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