This task regrids an ENVIRaster to a spatial grid raster, which is a raster that has been reprojected and resampled to a grid with a standard spatial reference, pre-defined pixel size, and the same number of rows and columns.

The virtual raster associated with this task is ENVISpatialGridRaster.

Example


This example regrids a raster to a different coordinate system. It defines a coordinate system object, creates a spatial grid definition, then reprojects the raster to the spatial grid.

; Start the application
e = ENVI()
 
; Open an input file
File = Filepath('qb_boulder_msi', Subdir=['data'], $
  Root_Dir=e.Root_Dir)
Raster = e.OpenRaster(File)
 
; Define a coordinate system object for
; Colorado State Plane FIPS 0501 NAD1983
CoordSys = ENVICoordSys(COORD_SYS_CODE=2231)
 
; Define a spatial grid
; Create a grid definition
; [xmin, ymax, xmax, ymin]
; x is easting and y is northing
Grid = ENVIGridDefinition(CoordSys, $
  PIXEL_SIZE=[9.186D,9.186D], $
  TIE_POINT_PIXEL=[0.0D,0.0D], $
  TIE_POINT_MAP=[3075299.7946D,1246937.9905D], $
  NROWS=Raster.NROWS, $
  NCOLUMNS=Raster.NCOLUMNS)
 
; Get the reprojection task from the catalog of ENVITasks
Task = ENVITask('RegridRaster')
 
; Define inputs
Task.INPUT_RASTER = Raster
Task.GRID_DEFINITION = Grid
 
; 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)
View.Zoom, /FULL_EXTENT

Syntax


Result = ENVITask('RegridRaster')

Input parameters (Set, Get): GRID_DEFINITION, INPUT_RASTER, OUTPUT_RASTER_URI, RESAMPLING

Output parameters (Get only): OUTPUT_RASTER

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


GRID_DEFINITION (optional)

Specify an ENVIGridDefinition object that defines the pixel size, rows and columns, and coordinate system of the desired spatial reference.

INPUT_RASTER (required)

Specify the raster to reproject.

OUTPUT_RASTER_URI (optional)

Specify a string with the fully qualified filename and path to export the associated OUTPUT_RASTER.

  • If you set this parameter to an asterisk symbol (*), the output raster will be virtual and not written to disk.
  • If you do not specify this parameter, or set it to an exclamation symbol (!), a temporary file will be created.
  • If you set it to the hash symbol (#), ENVI creates a file in the temporary directory, but this file will not be deleted when ENVI closes.

RESAMPLING (optional)

Specify the resampling method to use when creating the spatial grid:

  • 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.

Output Parameters


OUTPUT_RASTER

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

Methods


Execute

Parameter

ParameterNames

Properties


DESCRIPTION

DISPLAY_NAME

NAME

REVISION

TAGS

Version History


ENVI 5.2

Introduced

ENVI 5.5

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

See Also


ENVITask, ENVISpatialGridRaster, ENVIGridDefinition, ENVIReprojectRaster, RegridRasterSeriesByIndex Task, RegridRasterSeriesByIntersection Task, RegridRasterSeriesByUnion Task, Masking Support in ENVITasks