This task reprojects a series of rasters to a common spatial grid, using a custom grid definition.

Example


This example builds a raster series from a collection of Landsat MSS, TM, and OLI-8 images. They are all georeferenced to the same coordinate system (UTM Zone 11, WGS-84), but their sizes and resolution are different. The example creates a custom grid defnition in a Nevada East State Plane (2701) coordinate system, then regrids the rasters in the series to this common grid. To determine the spatial extent of the grid, we used an online calculator to convert from known latitude/longitude coordinates to State Plane coordinates.

The example uses sample images that are available from our ENVI Tutorials web page. Click the Landsat Case Studies link to download the .zip file to your machine, then unzip the files. Update the file location with your own directory.

; Start the application
e = ENVI()
 
; Select input rasters
Files = FILE_SEARCH('C:\MyFolder\', 'LasVegas*.dat')
numRasters = N_Elements(Files)
rasters = ObjArr(numRasters)
FOR i=0, (numRasters-1) DO $
  rasters[i] = e.OpenRaster(Files[i])
; Get the build raster series task from the catalog of ENVITasks
Task = ENVITask('BuildRasterSeries')
 
; Define inputs
Task.INPUT_RASTERS = rasters
 
; Run the task
Task.Execute
Series = Task.OUTPUT_RASTERSERIES
 
; Define a custom spatial grid
CoordSys = ENVICoordSys(COORD_SYS_CODE=3421)
 
; Specify the spatial extent
; [xmin, ymax, xmax, ymin]
; x is easting and y is northing
; Units are U.S. Survey Feet
Extent = [710244.695D, 26847237.473D, 888005.795D, 26680703.416D]
 
Grid = ENVIGridDefinition(CoordSys, $
  EXTENT=Extent, PIXEL_SIZE=[98.4252, 98.4252])
 
; Get the regrid task from the catalog of ENVITasks
RegridTask = ENVITask('RegridRasterSeries')
 
; Define inputs
RegridTask.GRID_DEFINITION = Grid
RegridTask.INPUT_RASTERSERIES = Series
 
; Run the task
RegridTask.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, RegridTask.OUTPUT_RASTERSERIES
 
; Display the result
View = e.GetView()
Layer = View.CreateLayer(RegridTask.OUTPUT_RASTERSERIES)
View.Zoom, /FULL_EXTENT

Syntax


Result = ENVITask('RegridRasterSeries')

Input properties (Set, Get): GRID_DEFINITION, INPUT_RASTERSERIES, OUTPUT_RASTERSERIES_URI, RESAMPLING

Output properties (Get only): OUTPUT_RASTERSERIES

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 (required)

Set this property to an ENVIGridDefinition object that defines the custom grid.

INPUT_RASTERSERIES (required)

Specify a raster series to reproject.

OUTPUT_RASTERSERIES

This is a reference to the output raster series.

OUTPUT_RASTERSERIES_URI (optional)

Specify a string with the fully-qualified path and filename for OUTPUT_RASTERSERIES.

RESAMPLING (optional)

Specify the resampling method.

  • 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


ENVI 5.3

Introduced

ENVI 5.5 Replaced INPUT_RASTERSERIES_URI with INPUT_RASTERSERIES

API Version


4.2

See Also


ENVITask, ENVIGridDefinition, RegridRasterSeriesByIndex Task, RegridRasterSeriesByIntersection Task, RegridRasterSeriesByUnion Task, BuildRasterSeries Task, BuildTimeSeries Task, ENVIRasterSeries, ENVIRasterSeriesLayer