Image intersection takes two rasters as input, and it outputs two rasters that cover only the overlapping area of two inputs. If the input rasters have different projections or pixel sizes, one of the output rasters will be reprojected or resampled so that the two output rasters have the same number of samples and lines. File inputs can have standard map projections, can be pixel-based, or can have RPC information.
Example
e = ENVI()
File1 = Filepath('world_dem', Subdir=['classic','data'], $
Root_Dir=e.Root_Dir)
Raster1 = e.OpenRaster(File1)
File2 = Filepath('egm96_global.dat', Subdir=['classic','data'], $
Root_Dir=e.Root_Dir)
Raster2 = e.OpenRaster(File2)
Task = ENVITask('ImageIntersection')
Task.INPUT_RASTER1 = Raster1
Task.INPUT_RASTER2 = Raster2
Task.Execute
DataColl = e.Data
DataColl.Add, Task.OUTPUT_RASTER1
DataColl.Add, Task.OUTPUT_RASTER2
View1 = e.GetView()
Layer1 = View1.CreateLayer(Task.OUTPUT_RASTER1)
View2 = e.CreateView()
Layer2 = View2.CreateLayer(Task.OUTPUT_RASTER2)
Syntax
Result = ENVITask('ImageIntersection')
Input properties (Set, Get): INPUT_RASTER1, INPUT_RASTER2, OUTPUT_RASTER1_URI, OUTPUT_RASTER2_URI, RESAMPLING, WARPING_METHOD
Output properties (Get only): OUTPUT_RASTER1, OUTPUT_RASTER2
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_RASTER1 (required)
Specify a raster to use as the base for computing the intersection.
INPUT_RASTER2 (required)
Specify a second raster for computing the intersection.
OUTPUT_RASTER1
This is a reference to the first output raster of filetype ENVI. The pixel size will match whichever has the higher resolution: INPUT_RASTER1 or INPUT_RASTER2.
OUTPUT_RASTER1_URI (optional)
Specify a string with the fully-qualified filename and path of the first 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.
OUTPUT_RASTER2
This is a reference to the second output raster of filetype ENVI. The following rules apply:
- The projection must match that of OUTPUT_RASTER1.
- The pixel size must be in the same units as those of OUTPUT_RASTER1.
- The pixel size will match whichever has the higher resolution: INPUT_RASTER1 or INPUT_RASTER2.
OUTPUT_RASTER2_URI (optional)
Specify a string with the fully-qualified filename and path of the second 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.
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.
WARPING_METHOD (optional)
Specify the warping method to use:
- Polynomial
- Rigorous
- Triangulation (default)
Version History
API Version
4.3
See Also
ENVITask