ENVIRegridRasterSeriesByIndexTask
This task reprojects a series of rasters to a common spatial grid, using the spatial reference of a selected raster index within the series.
Example
This example builds a raster series from a collection of Landsat MSS, TM, and -8 images. They are all georeferenced to the same coordinate system, but their sizes and resolution are different. The example uses the spatial grid parameters of the third raster in the series (LasVegasMay1985.dat) as the basis for reprojecting the other rasters in the series. Any raster that does not have the same dimensions and pixel size as the reference raster will be reprojected to its spatial grid.
The example uses sample images from the ENVI Resource DVD (in the LandsatCaseStudies\TimeSeries folder). The images are also available from the ENVI Tutorials web page. Click the "ENVI Tutorial Data" hyperlink. Copy the images to your local drive, and update the file location with your own directory.
e = ENVI()
Files = FILE_SEARCH('C:\Data', 'LasVegas*.dat')
numRasters = N_Elements(Files)
rasters = ObjArr(numRasters)
FOR i=0, (numRasters-1) DO $
rasters[i] = e.OpenRaster(Files[i])
Task = ENVITask('BuildRasterSeries')
Task.INPUT_RASTERS = rasters
Task.Execute
Series = Task.OUTPUT_RASTERSERIES
RegridTask = ENVITask('RegridRasterSeriesByIndex')
RegridTask.INPUT_RASTERSERIES = Series
RegridTask.RASTER_INDEX = 2
RegridTask.Execute
DataColl = e.Data
DataColl.Add, RegridTask.OUTPUT_RASTERSERIES
View = e.GetView()
Layer = View.CreateLayer(RegridTask.OUTPUT_RASTERSERIES)
Syntax
Result = ENVITask('RegridRasterSeriesByIndex')
Input properties (Set, Get):INPUT_RASTERSERIES, OUTPUT_RASTERSERIES_URI, RASTER_INDEX, 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:
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.
RASTER_INDEX (optional)
Specify a zero-based raster index in the series whose spatial reference will define the spatial grid parameters for the regridding. If you do not set this property, the first raster in the series will be used by default.
RESAMPLING (optional)
Specify the resampling method.
- Nearest Neighbor: Uses the nearest pixel without any interpolation.
- Bilinear (default): 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 |
Replaced INPUT_RASTERSERIES_URI with INPUT_RASTERSERIES |
API Version
3.3
See Also
ENVITask, ENVITask::Parameter, ENVIRegridRasterSeries, ENVIRegridRasterSeriesByIntersection, ENVIRegridRasterSeriesByUnion, ENVIGridDefinition, ENVIBuildRasterSeriesTask, ENVIBuildTimeSeriesTask, ENVIRasterSeries, ENVIRasterSeriesLayer