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 properties (Set, Get): GRID_DEFINITION, INPUT_RASTER, OUTPUT_RASTER_URI, RESAMPLING

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:

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

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.

  • If you set this property to an asterisk symbol (*), the output raster will be virtual and not written to disk.
  • If you do not specify this property, or set it to an exclamation symbol (!), a temporary file will be created.

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

Introduced

ENVI 5.5

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

API Version


4.2

See Also


ENVITask, ENVISpatialGridRaster, ENVIGridDefinition, ENVIReprojectRaster, RegridRasterSeriesByIndex Task, RegridRasterSeriesByIntersection Task, RegridRasterSeriesByUnion Task