Hello,
I have to subset a set of images with the same extentions (coordinates). So, I used the script below which I found on the help. The execution halted at the last instruction with this error message : "Keyword SPATIALREF not allowed in call to: ENVIRASTER::SUBSET".
Could you help me to overcome this error ?
Thank you.
The script:
Raster = e.OpenRaster(File)
; This is the area of interest:
UpperLeftLat = 35.1
UpperLeftLon = -112.1
LowerRightLat = 34.7
LowerRightLon = -111.6
; Get the spatial reference of the raster
SpatialRef = Raster.SPATIALREF
; Convert from Lon/Lat to MapX/MayY
SpatialRef.ConvertLonLatToMap, UpperLeftLon, UpperLeftLat, MapX, MapY
SpatialRef.ConvertLonLatToMap, LowerRightLon, LowerRightLat, MapX2, MapY2
; Define the geographic subset
Subset = Raster.Subset(SPATIALREF=SpatialRef, $
SUB_RECT=[MapX, MapY2, MapX2, MapY])
|