X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 12 Dec 2016 11:22 AM by  anon
Dealing with a rotated raster
 1 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:8
New Member


--
12 Dec 2016 11:22 AM
    I have a set of ~20 hyperspectral rasters I would like to subset to a region. I am trying to get the grid definition for each raster to I can see which raster overlaps with other rasters. However, under the spatial reference data for each raster, the rotation is set to -1 except for a single raster that has a rotation of -88. How to I add in the rotation information to the grid definiton to account for this rotation? Below is my current code. function gridDefinitionFromRaster, oRaster_init compile_opt idl2 oRaster = oRaster_init.SPATIALREF.dehydrate() ;oRasterCoordSys = ENVICoordSys(COORD_SYS_STR=oRaster.SPATIALREF.COORD_SYS_STR) oRasterCoordSys = ENVICoordSys(COORD_SYS_STR=oRaster['COORD_SYS_STR']) gridDefinition = ENVIGridDefinition(oRasterCoordSys, $ PIXEL_SIZE=oRaster['PIXEL_SIZE'], $ NROWS=oRaster_init.NROWS, $ ;ROTATION=oRaster['rotation'],$ NCOLUMNS=oRaster_init.NCOLUMNS, $ TIE_POINT_MAP=oRaster['TIE_POINT_MAP'], $ TIE_POINT_PIXEL=oRaster['TIE_POINT_PIXEL']) return, gridDefinition end

    MariM



    Veteran Member


    Posts:2396
    Veteran Member


    --
    13 Dec 2016 01:59 PM
    A grid definition is used to georeference images to the defined grid. So it isn't necessarily what you get from each raster but rather the definition to which all of your images might be projected. If you define a grid (lets say a UTM coordinate system code with a specific pixel size), then you might project your 20 hyperspectral images to this definition. In this case, an image that has rotation would most likely be rotated north to a rotation of 0 as well as be projected onto the new grid. This is typical during most reprojections. If your images are returning -1 for rotation, I believe this means that no rotation exists or was extracted from the file. In this case, they would be projected onto the new grid definition.
    You are not authorized to post a reply.