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
Example
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 from our ENVI Tutorials web page. Click the API Gridding Examples link to download the .zip file to your machine, then unzip the files.
- 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.
e = ENVI()
File1 = 'MODIS_LST_2009-03-07.dat'
MODISRaster = e.OpenRaster(File1)
File2 = 'VIIRSLST2014-03-07.dat'
VIIRSRaster = e.OpenRaster(File2)
CoordSys = ENVICoordSys(COORD_SYS_CODE=20354)
Grid = ENVIGridDefinition(CoordSys, $
EXTENT=[257017.6D, 7831362.4D, 1153892.7D, 7270425.0D], $
PIXEL_SIZE=[1000.0D, 1000.0D])
ReprojMODISRaster = ENVISpatialGridRaster(MODISRaster, $
GRID_DEFINITION=Grid)
ReprojVIIRSRaster = ENVISpatialGridRaster(VIIRSRaster, $
GRID_DEFINITION=Grid)
View = e.GetView()
Layer1 = View.CreateLayer(ReprojMODISRaster)
Layer2 = View.CreateLayer(ReprojVIIRSRaster)
Syntax
Result = ENVIGridDefinition(ENVICoordSys [, Properties=value])
Return Value
This routine returns a reference to a grid definition object.
Arguments
CoordSys
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:
Methods
ConvertGridToMap
ConvertMapToGrid
CreateGridFromCoordSys
Dehydrate
Hydrate
Intersection
Union
Properties
Properties marked as (Init) can be set during the initial creation of the object. Properties marked as (Get) can be retrieved. Properties marked as (Set) can be set after initial creation.
COORD_SYS (Init)
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.
PIXEL_SIZE (Init)
Specify a two-element array with the [x,y] pixel size in the same units as the associated ENVICoordSys object.
SPATIALREF (Get)
An ENVIStandardRasterSpatialRef object.
TIE_POINT_MAP (Init)
Specify a two-element array with the map coordinates of the TIE_POINT_PIXEL location, as follows:
[xmin, ymax]
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.
TIE_POINT_PIXEL (Init)
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].
Version History
ENVI 5.2 |
Introduced |
ENVI 5.3.1 |
Added Dehydrate method
|
ENVI 5.4 |
Added Hydrate method
|
API Version
4.3
See Also
ENVIRaster, ENVISpatialGridRaster, ENVIStandardRasterSpatialRef, ENVICoordSys, ENVILayerStackRaster, RegridRaster Task, ENVIMetaspectralRaster, BuildLayerStack Task, BuildGridDefinitionFromRaster Task, CalculateGridDefinitionFromRasterIntersection Task, CalculateGridDefinitionFromRasterUnion Task