This is a reference to a grid definition, which provides the information needed to georeference rasters and vectors to a common coordinate system. ENVIGridDefinition is only a definition, not a spatial reference or raster. It can be used as an input to ENVISpatialGridRaster or to define the grid parameters for an empty raster. It does not refer to any raster or rely on any specific raster to set its extents.
A grid definition provides the following information:
- Coordinate system
- Spatial (geographic) extent
- Pixel (cell) size
- Rows and columns
- Tie point pixel and map coordinates
This example defines a new spatial grid that is based on an Australian Map Grid Zone 54 coordinate system. Two images with different coordinate systems will reproject to this grid. The images are available on the ENVI Resource DVD (in the APIGriddingExamples folder) or from the ENVI Tutorials web page. Click the "ENVI Tutorial Data" hyperlink. Copy the images to your local drive.
- MODIS Land Surface Temperature (MOD11_L2) swath image from 07 March 2009, georeferenced to a UTM Zone 54 coordinate system using ENVI's Georeference MODIS tool, corrected for bowtie artifacts, spatially subsetted, and scaled by 0.02 so that the pixel values are in Kelvins.
- Suomi NPP VIIRS Land Surface Temperature EDR image from 07 March 2014, georeferenced to a Geographic Lat/Lon (WGS-84) coordinate system, and spatially subsetted.
; Start the application
e = ENVI()
; Open the MODIS LST raster
File1 = 'MODIS_LST_2009-03-07.dat'
MODISRaster = e.OpenRaster(File1)
; Open the Suomi NPP VIIRS LST raster
File2 = 'VIIRSLST2014-03-07.dat'
VIIRSRaster = e.OpenRaster(File2)
; Create a coordinate system object for
; Australian Map Grid (ADG84) Zone 54
CoordSys = ENVICoordSys(COORD_SYS_CODE=20354)
; Create a grid definition
; [xmin, ymax, xmax, ymin]
; x is easting and y is northing
Grid = ENVIGridDefinition(CoordSys, $
EXTENT=[257017.6D, 7831362.4D, 1153892.7D, 7270425.0D], $
; Reproject the MODIS image to the spatial grid
ReprojMODISRaster = ENVISpatialGridRaster(MODISRaster, $
; Reproject the VIIRS image to the spatial grid
ReprojVIIRSRaster = ENVISpatialGridRaster(VIIRSRaster, $
; Display the reprojected rasters
View = e.GetView()
Layer1 = View.CreateLayer(ReprojMODISRaster)
Layer2 = View.CreateLayer(ReprojVIIRSRaster)
Result = ENVIGridDefinition(ENVICoordSys [, Properties=value])
This routine returns a reference to a grid definition object.
Specify an ENVICoordSys object that defines the coordinate system to use for the grid definition. You can use the coordinate system of an open ENVIRaster or ENVIVector using its COORD_SYS property.
You can also reference a coordinate system by its code or string, which are located in the IDL installation folder under \IDLxx\resource\pedata\predefined:
EnviPEProjcsStrings.txt: projected coordinate system (PROJCS) codes and strings
- EnviPeGeogcs.txt: geographic coordinate system (GEOGCS) codes and strings
- On Windows sytems, these files are best viewed in the WordPad application. Use the Ctrl+F key combination to help find projection names.
Properties marked as (Init) are applied only during the initial creation of the object. Properties marked as (Get) can be retrieved but not set. All other properties can be set during the creation of the object, or retrieved or changed after creation.
The ENVICoordSys object that defines the coordinate system used for the grid definition.
EXTENTS (Init, Get)
Specify the geographic extent of the grid as follows:
[xmin, ymax, xmax, ymin]
where x and y are map coordinates (x=eastings, y=northings) or geographic coordinates (x=longitude, y=latitude), depending on the ENVICoordSys object. The coordinates must be in the same units (degrees, meters, feet, etc.) as the associated ENVICoordSys object.
If you set this property, you must also specify (1) PIXEL_SIZE or (2) NROWS and NCOLUMNS.
NCOLUMNS (Init, Get)
Specify the number of columns in the grid.
NROWS (Init, Get)
Specify the number of rows in the grid.
Specify a two-element array with the [x,y] pixel size in the same units as the associated ENVICoordSys object.
An ENVIStandardRasterSpatialRef object.
Specify a two-element array with the map coordinates of the TIE_POINT_PIXEL location, as follows:
The coordinates must be in the same units (degrees, meters, feet, etc.) as the associated ENVICoordSys object. If you set this property, you must also specify NROWS, NCOLUMNS, and PIXEL_SIZE.
Specify a two-element array with the pixel coordinates of the tie point. If you set this property, you must also specify TIE_POINT_MAP, NROWS, NCOLUMNS, and PIXEL_SIZE. If you do not set this property, the default pixel coordinates are [0,0].
ENVI 5.3, Service Pack 1
Added Dehydrate method
Added Hydrate method