Date: February 8, 2012 Tech Tip: Creating ENVI Map Projection Engine User Defined Objects Version: 2.0 Products: ENVI Platforms: All ENVI platforms are supported. Purpose: Creating user defined datums, geogcs's, geogtrans, projcs's and spheroids. Redefining pre-defined datums, geogcs's, geogtrans, projcs's and spheroids. Files ---------------------------------------------------------------------------------- Creating user a defined datum, geogcs, geogtran, projcs or spheroid is done by adding or updating one of the files listed below. datum.txt user-defined horizontal datums geogcs.txt user-defined geographic coordinate systems geogtran.txt user-defined geographic transformations projcs.txt user-defined projected coordinate systems spheroid.txt user-defined spheroids Not all of the above files need to be present.  The user only needs to provide files for those objects that are to be created or redefined. File Location ---------------------------------------------------------------------------------- The above files are to be created or updated in the following directory: [installdir]\IDL82\resource\pedata\user_defined File formats ---------------------------------------------------------------------------------- The format of the data in these files is: datum DATUM,code,"name", geogcs GEOGCS,code,"name",,, geogtran GEOGTRAN,code,"name",,,,,,..., , projcs PROJCS,code,"name",,,,,, spheroid SPHEROID,code,"name",,<1/f> Since commas are used as field delimiters, they should not be used in numerical values.  Always use decimal points in numbers.  Outside of quotes, any white-space is ignored and case is ignored for all strings.  Each entry must be completely contained in a single line. Just as when you define a coordinate system definition, you need to define any objects used by a higher level object. For example, if you want to define a geographic coordinate system, you may need to define the spheroid or datum you do not use a predefined spheroid or datum. Naming Rules for User Defined Datums and GCS's ---------------------------------------------------------------------------------- Rules for naming a user defined datum and the corresponding gcs - datum names must begin with a D_ prefix eg...D_FLAT_EARTH - gcs names must begin with a GCS_ prefix eg...GCS_FLAT_EARTH - datum names and gcs names must match after the prefix PE Prefixes ---------------------------------------------------------------------------------- Pre-defined names can be used in any of the above files when creating user defined objects. The prefixes are: Pre-defined horizontal datums (PE_D_*) Pre-defined geographic coordinate systems (PE_GCS_*) Pre-defined geographic transformations (PE_GT_*) Pre-defined methods (PE_MTH_*) Pre-defined parameters (PE_PAR_*) Pre-defined projected coordinate systems (PE_PROJCS_*) Pre-defined projections (PE_PRJ_*) Pre-defined spheroids (PE_S_*) Pre-defined Units (PE_U_*) Pre-defined Prime Meridians (PE_PM_*) See the ITTVIS ENVI Projection Engine Reference Tech Tip for a listing of the pre-defined names. User-defined code ranges ---------------------------------------------------------------------------------- Use codes in the 200000-209199 range. EPGS reserves 1-32766. ENVI defined objects are in the 32670-50000 and the 100000-199999 ranges. You should add 200000 to a standard code value when defining a new object. For example, predefined spheroids use 7001-7999. You must use 207001-207999 for enterprise-defined spheroids. If you use an existing code, your new definition will override the internal one. Numerical codes outside of the specified ranges are not recognized. User-defined ranges are: spheroid Spheroids 207000-207999 datum Horizontal datums 206000-206999 geogcs Geographic coordinate systems 204000-204999 projcs Projected coordinate systems 202000-203999 geogtran Geographic transformations 208000-208899 ENVI PE predefined code ranges ---------------------------------------------------------------------------------- The following are the pre-defined ranges for each data type. Do not use values in these ranges for creating user defined objects. Spheroids 7000 -  7999 107000 - 107999 Horizontal datums 6000 - 6999 106000 - 106999 Geographic coordinate systems 4000 -   4999 37000 - 37999 104000 - 104999 Projected coordinate systems 2000 -  3999 20000 - 32799 53000 - 54999 65000 - 65199 102000 - 103999 Geographic transformations 1000 -   1999 8000 -   8899 10000 - 10099 15700 - 15899 108000 - 108899 Examples ---------------------------------------------------------------------------------- The lines below would each be located in the corresponding file in the [installdir]\IDL82\resource\pedata\user_defined directory.   example 1: ---------- SPHEROID,207001,"s_207001_clarke_1866_mod",6378206.4,294.9786982 DATUM,206001,"d_clarke_1866_mod",207001 GEOGCS,204001,"gcs_clarke_1866_mod",206001,PE_PM_GREENWICH,PE_U_DEGREE GEOGTRAN,208001,"gt_clarke_1866_mod_to_wgs84",204001,PE_GCS_WGS_1984,PE_MTH_GEOCENTRIC_TRANSLATION,PE_PAR_X_AXIS_TRANSLATION,-3,PE_PAR_Y_AXIS_TRANSLATION,142,PE_PAR_Z_AXIS_TRANSLATION,183 example 2: ---------- DATUM,206002,"d_datum2",PE_S_BESSEL_NAMIBIA GEOGCS,204002,"gcs_gcs2",206002,PE_PM_GREENWICH,PE_U_DEGREE GEOGTRAN,208001,"gt_gcs2_to_wgs84",204002,PE_GCS_WGS_1984,PE_MTH_GEOCENTRIC_TRANSLATION,PE_PAR_X_AXIS_TRANSLATION,100,PE_PAR_Y_AXIS_TRANSLATION,200,PE_PAR_Z_AXIS_TRANSLATION,300 PROJCS,202001,"projcs_tm_specific_loc",204002,PE_PRJ_MERCATOR,PE_PAR_FALSE_NORTHING,500000,PE_PAR_FALSE_EASTING,200000,PE_PAR_CENTRAL_MERIDIAN,-112.0,PE_U_METER   Determing If Your User Defined Objects Are Recognized By ENVI ---------------------------------------------------------------------------------- ; this pro code routine can be used to determine if your user defined object was recognized. ; this code will print out all the pre-defined and user defined objects currently available. ; after editing your user defined files you must restart ENVI or do a full reset. pro GetObjectTable, option ; you can change the optionValue to any option value listed below optionValue = 1 res = map_pe_get_option_table(optionValue, x) num = n_elements(x) for i=0, num-1 do begin print, format='(%" %6s, %7s, %s")', strtrim(x[i].Count,2), strtrim(x[i].Code,2), x[i].Name endfor end Option Values 0 = AngularUnitsTbl 1 = DatumTbl 2 = GeoTranTbl 3 = GeogcsTbl 4 = HTMethodsTbl 5 = LinearUnitsTbl 6 = MethodsTbl 7 = ParamTbl 8 = PrimemTbl 9 = ProjcsTbl 10 = ProjectionTbl 11 = SpheroidTbl 12 = VDatumTbl 13 = VertcsTbl