This is a reference to an ENVICoordSys object, which contains the coordinate system information for raster and vector files. If you issue a PRINT command on this object, all properties are listed regardless of the spatial reference type.

Example 1


This example creates an ENVICoordSys object from the coordinate system of an opened vector file:

; Launch the application
e = ENVI()
 
; Open a shapefile
file = FILEPATH('qb_boulder_msi_vectors.shp', $
  SUBDIRECTORY = ['data'], ROOT_DIR=e.Root_Dir)
 
; Create an ENVIVector from the shapefile data
vector = e.OpenVector(file)
 
; Get the coordinate system information
; of the vector file
CoordSys = vector.COORD_SYS
PRINT, CoordSys

IDL prints:

ENVICOORDSYS <265130>
COORD_SYS_CODE            = 0
COORD_SYS_STR             = 'GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]]'

Example 2


This example creates an ENVICoordSys object based on a known coordinate system code (see the COORD_SYS_CODE description below):

; Launch the application
e = ENVI()
 
; Create an ENVICoordSys object
CoordSys = ENVICoordSys(COORD_SYS_CODE=20354)
PRINT, CoordSys

IDL prints:

ENVICOORDSYS <265132>
COORD_SYS_CODE            = 20354
COORD_SYS_STR             = 'PROJCS["AGD_1984_AMG_Zone_54",GEOGCS["GCS_Australian_1984",DATUM["D_Australian_1984",SPHEROID["Australian",6378160.0,298.25]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["False_Easting",500000.0],PARAMETER["False_Northing",10000000.0],PARAMETER["Central_Meridian",141.0],PARAMETER["Scale_Factor",0.9996],PARAMETER["Latitude_Of_Origin",0.0],UNIT["Meter",1.0]]'

Syntax


Result = ENVICoordSys([, Keywords=value] [, Properties=value])

Or:

ENVICoordSys = ENVIVector.COORD_SYS

Methods


ConvertLonLatToLonLat

ConvertLonLatToMap

ConvertLonLatToMGRS

ConvertMapToLonLat

ConvertMapToMap

ConvertMGRSToLonLat

Dehydrate

Hydrate

Keywords


You must set one of the following keywords:

COORD_SYS_CODE (optional)

Set this keyword to a valid 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 (optional)

Set this keyword to a valid 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

ERROR

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.

Properties


Properties marked as (Get) can be retrieved, but not set.

COORD_SYS_CODE (Get)

Get the geographic (GEOGCS) or projected (PROJCS) coordinate system code associated with an ENVICoordSys object.

COORD_SYS_STR (Get)

Get the geographic (GEOGCS) or projected (PROJCS) coordinate system string associated with an ENVICoordSys object.

Version History


ENVI 5

Introduced

ENVI 5.1

Added Convert* methods

ENVI 5.2

Added COORD_SYS_CODE and COORD_SYS_STRING keywords. Added ability for ENVICoordSys to serve as a constructor function for creating new coordinate system objects.

ENVI 5.3.1

Added Dehydrate method

ENVI 5.4

Added Hydrate method

API Version


4.3

See Also


ENVIVector, ENVIRaster, ENVIGridDefinition