INTERNAL: How to add a datum that is *not* supported by the ESRI Projection Engine to ENVI
Anonym
Although the ESRI Projection Engine contains over 600 pre-defined datums some users may find it necessary to define their own custom datum to address the needs of a specific area of interest. The flexibility provided by the integration of the Projection Engine into ENVI now allows users to create a custom user-defined datum through ENVI that is recognized and supported by the Projection Engine.
Creating a user-defined datum is fairly straightforward and is done by either building or updating the following files:
- datum.txt user-defined horizontal datums
- spheroid.txt user-defined spheroids
The above files need to reside in the following directory:
[installdir]\ITT\IDL\IDL8x\products\envicommon\resource\pedata\user_defined
Note:
This directory or its contents should not be moved to another location. ENVI is only able to look in this location for any user-defined parameters that the Projection Engine may require.
Suppose one wanted to add a fictional datum called 'D_clarke_1866_mod' that uses a fictional spheroid named 'S_207001_clarke_1866_mod'. The spheroid has the following parameters:
semi-major axis: 6378206.4 m
1/f : 294.9786982 m
(f is known as the datum flattening factor and is a ratio between the major and minor axis of the spheroid.)
Follow these steps to create the datum and allow it to be recognized by the Projection Engine:
- Create a 'spheroid.txt' file and place it in the following directory:
[installdir]\ITT\IDL\IDL8x\products\envicommon\resource\pedata\user_defined
- Add the following line to that file:
SPHEROID, 207001, "S_207001_clarke_1866_mod",6378206.4,294.9786982
- Create a 'datum.txt' file and place it in the same directory.
- Add the following line to this file:
DATUM, 206001,"D_clarke_1866_mod",207001
- Save the files. For the new information to be recognized, ENVI needs to be closed and restarted.
Note:
The naming conventions as outlined in Creating ENVI Map Projection Engine User Defined Objects must be strictly adhered to.
For example, user-defined datum names must begin with a D_ prefix and must use a 206000-206999 code range as seen in step 4.
The methods used to confirm that the datum was accepted by the Projection Engine depends on whether you have ENVI Runtime or ENVI + IDL.
ENVI Runtime:
ENVI Runtime users need to use the following *.sav file: Get_PE_Datum_List.sav
The steps needed to add this functionality to ENVI Runtime can be found in the following article:
How to create an ENVI *.sav file
When the Get_PE_Datum_List.sav file is run it will ask the user to define an output file name within a directory of the users choice. This *.txt file will list all the standard datums included within the Projection Engine and include any new user-defined datums. New datums are listed according to their alphabetic order.
ENVI + IDL:
Copy and paste the code below into the Workbench, then Compile and Run the code. When the Get_PE_Datum_List.pro file is run it will ask the user to define an output file name within a directory of the users choice. This *.txt file will list all the standard datums included within the Projection Engine and include any new user-defined datums. New datums are listed according to their alphabetic order.
If users would like to make a datum from the Projection Engine directly available in ENVI modifications must be made to following files located in C:\Program Files\ITT\IDL\IDL8x\products\envixx\map_proj (Windows):
- datum.txt
- ellipse.txt
The ellipse.txt file follows this sytax convention: ellipse name, majoraxis, minoraxis
The datum.txt file follows this syntax convention: name, ellipse name, x, y, z
(x, y, z are the offsets from the WGS 84 datum)
For the new information to be recognized, ENVI needs to be closed and restarted.