X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 09 Mar 2017 06:02 AM by  anon
Raster subset
 1 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:3
New Member


--
09 Mar 2017 06:02 AM
    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])

    Deleted User



    New Member


    Posts:24
    New Member


    --
    14 Mar 2017 07:39 AM
    The problem is the name of the function: ENVISubsetRaster, not Subset. Eg: ms_layerstack = e.OpenRaster(layerDN) ms = ENVISubsetRaster(ms_layerstack , BANDS =[1,2,3])
    You are not authorized to post a reply.