This is a reference to an ENVIStandardRasterSpatialRef object, which contain properties that describe a standard spatial reference associated with an ENVIRaster.

Example


The most common programmatic use for ENVIStandardRasterSpatialRef is retrieving spatial properties from an ENVIRaster that contains a standard spatial reference. This is stored in the raster's SPATIALREF property. The following code shows a general example:

; Open a raster that contains a standard spatial reference
File = 'MyRaster.dat'
Raster = e.OpenRaster(File)
 
; Retrieve and print the properties of the spatial reference
Print, Raster.SPATIALREF
 
; Print the pixel size of the raster
Print, Raster.SPATIALREF.PIXEL_SIZE

Syntax


Result = ENVIStandardRasterSpatialRef([, Properties=value, ERROR=value])

Methods


ConvertFileToFile

ConvertFileToLonLat

ConvertFileToMap

ConvertLonLatToFile

ConvertLonLatToLonLat

ConvertLonLatToMap

ConvertLonLatToMGRS

ConvertMapToFile

ConvertMapToLonLat

ConvertMapToMap

ConvertMGRSToLonLat

Dehydrate

Hydrate

NorthIsUpAngle

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_CODE (Init, Get)

Use this property to get a geographic (GEOGCS) or projected (PROJCS) coordinate system code.

For a full list of coordinate system strings and codes, refer to the following text files in the \IDLxx\resource\pedata\predefined directory of the ENVI distribution:

  • EnviPEProjcsStrings.txt: PROJCS codes and strings
  • EnviPEGeogcsStrings.txt: GEOGCS codes and strings

COORD_SYS_STR (Init, Get)

Use this property to get a geographic (GEOGCS) or projected (PROJCS) coordinate system string.

For a full list of coordinate system strings and codes, refer to the following text files in the \IDLxx\resource\pedata\predefined directory of the ENVI distribution:

  • EnviPEProjcsStrings.txt: PROJCS codes and strings
  • EnviPEGeogcsStrings.txt: GEOGCS codes and strings

GEOGCS (Init, Get)

Set this property when retrieving a geographic coordinate system code or string. Use in conjunction with the COORD_SYS_CODE or COORD_SYS_STR property.

PIXEL_SIZE (Init, Get, required)

This is a two-element array [X Pixel Size, Y Pixel Size] specifying the pixel size of the data. The pixel sizes must be in the same units as the coordinate system.

PROJCS (Init, Get)

Set this property when retrieving a projected coordinate system code or string. Use in conjunction with the COORD_SYS_CODE or COORD_SYS_STR property.

ROTATION (Init, Get)

This property specifies the rotation of the image in the defined projection (degrees clockwise from North).

TIE_POINT_MAP (Init, Get, required)

This property is a two-element array [X Tie Point, Y Tie Point] representing the map location that corresponds to the pixel location (TIE_POINT_PIXEL).

TIE_POINT_PIXEL (Init, Get, required)

This property is a two-element array [X Pixel, Y Pixel] representing the pixel location that corresponds to the map location (TIE_POINT_MAP). The tie-point pixel location must be in the same units as the coordinate system.

The default location of the upper-left pixel for images displayed in ENVI is (0,0). The reference (tie point) pixel values in the map info field of an ENVI header file are one-based. If the TIE_POINT_PIXEL values come directly from an ENVI header file, you must subtract 1 from x and y.

Note: From the ENVI 5 release to the ENVI 5.0.2 release, the upper-left pixel for images was (1,1).

Keywords


ERROR (optional)

Set this keyword to a named variable that will contain any error message issued during execution of this routine. If no error occurs, the ERROR variable will be set to a null string (''). If an error occurs and the routine is a function, then the function result will be undefined.

When this keyword is not set and an error occurs, ENVI returns to the caller and execution halts. In this case, the error message is contained within !ERROR_STATE and can be caught using IDL's CATCH routine. See IDL Help for more information on !ERROR_STATE and CATCH.

See Manage Errors for more information on error handling in ENVI programming.

Version History


ENVI 5.1

Introduced; Added ability to serve as a constructor function for creating new standard spatial reference objects.

ENVI 5.2

Documented GEOGCS and PROJCS properties.

ENVI 5.3.1

Added Dehydrate method

ENVI 5.4

Added Hydrate method

ENVI 5.6.3 Added NorthIsUpAngle method.

API Version


4.2

See Also


ENVIGLTRasterSpatialRef, ENVIPseudoRasterSpatialRef, ENVIRPCRasterSpatialRef, ENVISpatialGridRaster