Welcome to the Harris Geospatial product documentation center. Here you will find reference guides, help documents, and product libraries.


Harris Geospatial / Docs Center / ENVI API / Data Control / ENVIStandardRasterSpatialRef

ENVIStandardRasterSpatialRef

ENVIStandardRasterSpatialRef

This is a reference to an ENVIStandardRasterSpatialRef object.

See the example code for instructions on creating an ENVIStandardRasterSpatialRef object. You can also retrieve a reference to an ENVIStandardRasterSpatialRef object associated with a raster with ENVIRaster's SPATIALREF property.

If a data set has more than one type of map information (for example, a standard map projection and rational polynomial coefficients (RPCs)), the standard map projection will take precedence and determine the base projection.

Note: To achieve the highest level of accuracy when creating this object, specify values as double-precision floating point numbers.

Example


; Launch the application
e = ENVI()
 
; Create a custom spatial reference object
spatialRef1 = ENVIStandardRasterSpatialRef( $
  COORD_SYS_CODE=2231, /PROJCS, $
  PIXEL_SIZE=[9.186D,9.186D], TIE_POINT_PIXEL=[0.0D,0.0D], $
  TIE_POINT_MAP=[3075299.7946D,1246937.9905D])
 
; Open a file but override its spatial reference information
file = FILEPATH('qb_boulder_msi', ROOT_DIR=e.ROOT_DIR, $
  SUBDIRECTORY = ['data'])
raster = e.OpenRaster(file, SPATIALREF_OVERRIDE=spatialRef1)
 
; Retrieve and print the spatial reference 
spatialRef = raster.SPATIALREF
PRINT, spatialRef

Syntax


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

Methods


ConvertFileToFile

ConvertFileToMap

ConvertLonLatToLonLat

ConvertLonLatToMap

ConvertLonLatToMGRS

ConvertMapToFile

ConvertMapToLonLat

ConvertMapToMap

ConvertMGRSToLonLat

Dehydrate

Hydrate

Properties


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.

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 Service Pack 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, Service Pack 1

Added Dehydrate method

ENVI 5.4

Added Hydrate method

API Version


3.1.0

See Also


ENVIGLTRasterSpatialRef, ENVIPseudoRasterSpatialRef, ENVIRPCRasterSpatialRef, ENVISpatialGridRaster



© 2017 Exelis Visual Information Solutions, Inc. |  Legal
My Account    |    Buy    |    Contact Us