The ApplyOffset function method subtracts a designated pixel offset from all of the GCPs in an ENVIGCPSet object. Use this method when applying GCPs from a full input image to a spatially subsetted image with the RPCOrthorectification task.
If you set the OUTPUT_SUBSET property on the RPCOrthorectification task, you do not need to use the ApplyOffset method.
Example
The following example shows the use of ApplyOffset with a spatially subsetted image.
e = ENVI()
ImageFile = Dialog_Pickfile(TITLE='Select an input image')
Raster = e.OpenRaster(ImageFile)
RasterSubset = ENVISubsetRaster(Raster, SUB_RECT=[200, 300, 400, 400])
DEMFile = Dialog_Pickfile(TITLE='Select a DEM file')
DEM = e.OpenRaster(DEMFile)
GCPFile = Dialog_Pickfile($,
TITLE='Select a GCP shapefile or ENVI .pts file')
GCPs = ENVIGCPSet(GCPFile)
NewGCPs = GCPs.ApplyOffset(200, 300)
Task = ENVITask('RPCOrthorectification')
Task.Input_Raster = RasterSubset
Task.DEM_Raster = DEM
Task.Input_GCP = NewGCPs
Task.Output_Raster_URI = e.GetTemporaryFilename()
Task.Execute, ERROR=error
RasterSubset.Close
Syntax
Result = ENVIGCPSet.ApplyOffset(xOff, yOff [, ERROR=variable])
Return Value
This method returns a reference to a new ENVIGCPSet object.
Arguments
xOff
The subset x1 value
yOff
The subset y1 value
Keywords
ERROR
Set this keyword to a named variable that will contain any error message issued during execution of this routine. If no error occurs, the ERROR variable will be set to a null string (''). If an error occurs and the routine is a function, then the function result will be undefined.
When this keyword is not set and an error occurs, ENVI returns to the caller and execution halts. In this case, the error message is contained within !ERROR_STATE and can be caught using IDL's CATCH routine. See IDL Help for more information on !ERROR_STATE and CATCH.
See Manage Errors for more information on error handling in ENVI programming.
Version History
API Version
4.3
See Also
ENVIGCPSet