# Script to get native units of a map projection.
# (Handles all dec deg, meter or foot projections.)
#
# Copyright 2000 Earthstar Geographics.
# 
# Script:   ESG_Get_Proj_Units.erb
# Version:	1.0
# Date:     January 2000
# Author:   Eric Augenstein (eric@es-geo.com)

# Details:	Input - $get_units_arg1 - map projection of alg
#		(get using $get_units_arg1 = get algorithm projection)  
#		Output - $units_return - projection units (feet, meters or decimal degrees)

# Alg projection must be checked so if coordinates are feet,
# appropriate conversion of EN values to meters is done
# to get the right image size.

# Geodetic case
if ($get_units_arg1 == "GEODETIC") then goto got_dd_units

# Foot-based projections in GDTDATA as of ER Mapper 6.1
if ($get_units_arg1 == "ALGULFFT") then goto got_foot_unit 
if ($get_units_arg1 == "LM1JAFT") then goto got_foot_unit
if ($get_units_arg1 == "L2ALSK10F83") then goto got_foot_unit 
if ($get_units_arg1 == "LM2ARKNF") then goto got_foot_unit
if ($get_units_arg1 == "L2ARKNF83") then goto got_foot_unit
if ($get_units_arg1 == "LM2ARKSF") then goto got_foot_unit
if ($get_units_arg1 == "L2ARKSF83") then goto got_foot_unit
if ($get_units_arg1 == "LM2CAL1F") then goto got_foot_unit
if ($get_units_arg1 == "L2CAL1F83") then goto got_foot_unit
if ($get_units_arg1 == "LM2CAL2F") then goto got_foot_unit
if ($get_units_arg1 == "L2CAL2F83") then goto got_foot_unit
if ($get_units_arg1 == "LM2CAL3F") then goto got_foot_unit
if ($get_units_arg1 == "L2CAL3F83") then goto got_foot_unit
if ($get_units_arg1 == "LM2CAL4F") then goto got_foot_unit
if ($get_units_arg1 == "L2CAL4F83") then goto got_foot_unit
if ($get_units_arg1 == "LM2CAL5F") then goto got_foot_unit
if ($get_units_arg1 == "L2CAL5F83") then goto got_foot_unit
if ($get_units_arg1 == "LM2CAL6F") then goto got_foot_unit
if ($get_units_arg1 == "L2CAL6F83") then goto got_foot_unit
if ($get_units_arg1 == "LM2CAL7F") then goto got_foot_unit
if ($get_units_arg1 == "LM2COLCF") then goto got_foot_unit
if ($get_units_arg1 == "L2COLCF83") then goto got_foot_unit
if ($get_units_arg1 == "LM2COLNF") then goto got_foot_unit
if ($get_units_arg1 == "L2COLNF83") then goto got_foot_unit
if ($get_units_arg1 == "LM2COLSF") then goto got_foot_unit
if ($get_units_arg1 == "L2COLSF83") then goto got_foot_unit
if ($get_units_arg1 == "LM2CONNF") then goto got_foot_unit
if ($get_units_arg1 == "L2CONNF83") then goto got_foot_unit
if ($get_units_arg1 == "LM2FLANF") then goto got_foot_unit
if ($get_units_arg1 == "L2FLANF83") then goto got_foot_unit
if ($get_units_arg1 == "LM2GULF") then goto got_foot_unit
if ($get_units_arg1 == "LM2IOWNF") then goto got_foot_unit
if ($get_units_arg1 == "L2IOWNF83") then goto got_foot_unit
if ($get_units_arg1 == "LM2IOWSF") then goto got_foot_unit
if ($get_units_arg1 == "L2IOWSF83") then goto got_foot_unit
if ($get_units_arg1 == "LM2KANNF") then goto got_foot_unit
if ($get_units_arg1 == "L2KANNF83") then goto got_foot_unit
if ($get_units_arg1 == "L2KANSF83") then goto got_foot_unit
if ($get_units_arg1 == "LM2KYNFT") then goto got_foot_unit
if ($get_units_arg1 == "L2KYNFT83") then goto got_foot_unit
if ($get_units_arg1 == "LM2KYSFT") then goto got_foot_unit
if ($get_units_arg1 == "L2KYSFT83") then goto got_foot_unit
if ($get_units_arg1 == "LM2LANFT") then goto got_foot_unit
if ($get_units_arg1 == "L2LANFT83") then goto got_foot_unit
if ($get_units_arg1 == "LM2LAOFT") then goto got_foot_unit
if ($get_units_arg1 == "L2LAOFT83") then goto got_foot_unit
if ($get_units_arg1 == "LM2LASFT") then goto got_foot_unit
if ($get_units_arg1 == "L2LASFT83") then goto got_foot_unit
if ($get_units_arg1 == "LM2MARYF") then goto got_foot_unit
if ($get_units_arg1 == "L2MARYF83") then goto got_foot_unit
if ($get_units_arg1 == "LM2MASIF") then goto got_foot_unit
if ($get_units_arg1 == "L2MASIF83") then goto got_foot_unit
if ($get_units_arg1 == "LM2MASMF") then goto got_foot_unit
if ($get_units_arg1 == "L2MASMF83") then goto got_foot_unit
if ($get_units_arg1 == "LM2MICCF") then goto got_foot_unit
if ($get_units_arg1 == "L2MICCF83") then goto got_foot_unit
if ($get_units_arg1 == "LM2MICNF") then goto got_foot_unit
if ($get_units_arg1 == "L2MICNF83") then goto got_foot_unit
if ($get_units_arg1 == "LM2MICSF") then goto got_foot_unit
if ($get_units_arg1 == "L2MICSF83") then goto got_foot_unit
if ($get_units_arg1 == "LM2MINCF") then goto got_foot_unit
if ($get_units_arg1 == "L2MINCF83") then goto got_foot_unit
if ($get_units_arg1 == "LM2MINNF") then goto got_foot_unit
if ($get_units_arg1 == "L2MINNF83") then goto got_foot_unit
if ($get_units_arg1 == "LM2MINSF") then goto got_foot_unit
if ($get_units_arg1 == "L2MINSF83") then goto got_foot_unit
if ($get_units_arg1 == "LM2MOCFT") then goto got_foot_unit
if ($get_units_arg1 == "LM2MONFT") then goto got_foot_unit
if ($get_units_arg1 == "LM2MOSFT") then goto got_foot_unit
if ($get_units_arg1 == "LM2MTCFT") then goto got_foot_unit
if ($get_units_arg1 == "L2MTF83") then goto got_foot_unit
if ($get_units_arg1 == "LM2MTNFT") then goto got_foot_unit
if ($get_units_arg1 == "LM2MTSFT") then goto got_foot_unit
if ($get_units_arg1 == "LM2NCAFT") then goto got_foot_unit
if ($get_units_arg1 == "L2NCAFT83") then goto got_foot_unit
if ($get_units_arg1 == "LM2NDNFT") then goto got_foot_unit
if ($get_units_arg1 == "L2NDNFT83") then goto got_foot_unit
if ($get_units_arg1 == "LM2NDSFT") then goto got_foot_unit
if ($get_units_arg1 == "L2NDSFT83") then goto got_foot_unit
if ($get_units_arg1 == "L2NEBF83") then goto got_foot_unita
if ($get_units_arg1 == "LM2NEBNF") then goto got_foot_unit
if ($get_units_arg1 == "LM2NEBSF") then goto got_foot_unit
if ($get_units_arg1 == "LM2NEWYF") then goto got_foot_unit
if ($get_units_arg1 == "L2NEWYF83") then goto got_foot_unit
if ($get_units_arg1 == "LM2OHINF") then goto got_foot_unit
if ($get_units_arg1 == "L2OHINF83") then goto got_foot_unit
if ($get_units_arg1 == "LM2OHISF") then goto got_foot_unit
if ($get_units_arg1 == "L2OHISF83") then goto got_foot_unit
if ($get_units_arg1 == "LM2OKLNF") then goto got_foot_unit
if ($get_units_arg1 == "L2OKLNF83") then goto got_foot_unit
if ($get_units_arg1 == "LM2OKLSF") then goto got_foot_unit
if ($get_units_arg1 == "L2OKLSF83") then goto got_foot_unit
if ($get_units_arg1 == "LM2ORENF") then goto got_foot_unit
if ($get_units_arg1 == "L2ORENF83") then goto got_foot_unit
if ($get_units_arg1 == "LM2ORESF") then goto got_foot_unit
if ($get_units_arg1 == "L2ORESF83") then goto got_foot_unit
if ($get_units_arg1 == "LM2PANFT") then goto got_foot_unit
if ($get_units_arg1 == "L2PANFT83") then goto got_foot_unit
if ($get_units_arg1 == "LM2PASFT") then goto got_foot_unit
if ($get_units_arg1 == "L2PASFT83") then goto got_foot_unit
if ($get_units_arg1 == "LM2PRV1F") then goto got_foot_unit
if ($get_units_arg1 == "L2PRVF83") then goto got_foot_unita
if ($get_units_arg1 == "LM2PRV2F") then goto got_foot_unit
if ($get_units_arg1 == "LM2SCNFT") then goto got_foot_unit
if ($get_units_arg1 == "LM2SCSFT") then goto got_foot_unit
if ($get_units_arg1 == "L2SCFT83") then goto got_foot_unita
if ($get_units_arg1 == "LM2SDNFT") then goto got_foot_unit
if ($get_units_arg1 == "L2SDNFT83") then goto got_foot_unit
if ($get_units_arg1 == "LM2SDSFT") then goto got_foot_unit
if ($get_units_arg1 == "L2SDSFT83") then goto got_foot_unit
if ($get_units_arg1 == "LM2TENNF") then goto got_foot_unit
if ($get_units_arg1 == "L2TENNF83") then goto got_foot_unit
if ($get_units_arg1 == "LM2TXCF") then goto got_foot_unit
if ($get_units_arg1 == "L2TXCF83") then goto got_foot_unita
if ($get_units_arg1 == "LM2TXNCF") then goto got_foot_unit
if ($get_units_arg1 == "L2TXNCF83") then goto got_foot_unit
if ($get_units_arg1 == "LM2TXNF") then goto got_foot_unit
if ($get_units_arg1 == "L2TXNF83") then goto got_foot_unita
if ($get_units_arg1 == "LM2TXSCF") then goto got_foot_unit
if ($get_units_arg1 == "L2TXSCF83") then goto got_foot_unit
if ($get_units_arg1 == "LM2TXSF") then goto got_foot_unit
if ($get_units_arg1 == "L2TXSF83") then goto got_foot_unita
if ($get_units_arg1 == "LM2UTHCF") then goto got_foot_unit
if ($get_units_arg1 == "L2UTHCF83") then goto got_foot_unit
if ($get_units_arg1 == "LM2UTHNF") then goto got_foot_unit
if ($get_units_arg1 == "L2UTHNF83") then goto got_foot_unit
if ($get_units_arg1 == "LM2UTHSF") then goto got_foot_unit
if ($get_units_arg1 == "L2UTHSF83") then goto got_foot_unit
if ($get_units_arg1 == "LM2VIRNF") then goto got_foot_unit
if ($get_units_arg1 == "L2VIRNF83") then goto got_foot_unit
if ($get_units_arg1 == "LM2VIRSF") then goto got_foot_unit
if ($get_units_arg1 == "L2VIRSF83") then goto got_foot_unit
if ($get_units_arg1 == "LM2WISCF") then goto got_foot_unit
if ($get_units_arg1 == "L2WISCF83") then goto got_foot_unit
if ($get_units_arg1 == "LM2WISNF") then goto got_foot_unit
if ($get_units_arg1 == "L2WISNF83") then goto got_foot_unit
if ($get_units_arg1 == "LM2WISSF") then goto got_foot_unit
if ($get_units_arg1 == "L2WISSF83") then goto got_foot_unit
if ($get_units_arg1 == "LM2WSHNF") then goto got_foot_unit
if ($get_units_arg1 == "L2WSHNF83") then goto got_foot_unit
if ($get_units_arg1 == "LM2WSHSF") then goto got_foot_unit
if ($get_units_arg1 == "L2WSHSF83") then goto got_foot_unit
if ($get_units_arg1 == "LM2WVANF") then goto got_foot_unit
if ($get_units_arg1 == "L2WVANF83") then goto got_foot_unit
if ($get_units_arg1 == "LM2WVASF") then goto got_foot_unit
if ($get_units_arg1 == "L2WVASF83") then goto got_foot_unit
if ($get_units_arg1 == "OMALSK1F") then goto got_foot_unit
if ($get_units_arg1 == "PCALASKA") then goto got_foot_unit
if ($get_units_arg1 == "PCALBERT") then goto got_foot_unit
if ($get_units_arg1 == "PCNSLOPE") then goto got_foot_unit
if ($get_units_arg1 == "PCNWT ") then goto got_foot_unitca
if ($get_units_arg1 == "PCTRUSFT") then goto got_foot_unit
if ($get_units_arg1 == "STMLO25F") then goto got_foot_unit
if ($get_units_arg1 == "STMLO27F") then goto got_foot_unit
if ($get_units_arg1 == "TMAFT15") then goto got_foot_unit
if ($get_units_arg1 == "TMAFT16") then goto got_foot_unit
if ($get_units_arg1 == "TMAFT17") then goto got_foot_unit
if ($get_units_arg1 == "TMALABEF") then goto got_foot_unit
if ($get_units_arg1 == "TMALABEF83") then goto got_foot_unit
if ($get_units_arg1 == "TMALABWF") then goto got_foot_unit
if ($get_units_arg1 == "TMALABWF83") then goto got_foot_unit
if ($get_units_arg1 == "TMALSK2F") then goto got_foot_unit
if ($get_units_arg1 == "TMALSK2F83") then goto got_foot_unit
if ($get_units_arg1 == "TMALSK3F") then goto got_foot_unit
if ($get_units_arg1 == "TMALSK3F83") then goto got_foot_unit
if ($get_units_arg1 == "TMALSK4F") then goto got_foot_unit
if ($get_units_arg1 == "TMALSK4F83") then goto got_foot_unit
if ($get_units_arg1 == "TMALSK5F") then goto got_foot_unit
if ($get_units_arg1 == "TMALSK5F83") then goto got_foot_unit
if ($get_units_arg1 == "TMALSK6F") then goto got_foot_unit
if ($get_units_arg1 == "TMALSK6F83") then goto got_foot_unit
if ($get_units_arg1 == "TMALSK7F") then goto got_foot_unit
if ($get_units_arg1 == "TMALSK7F83") then goto got_foot_unit
if ($get_units_arg1 == "TMALSK8F") then goto got_foot_unit
if ($get_units_arg1 == "TMALSK8F83") then goto got_foot_unit
if ($get_units_arg1 == "TMALSK9F") then goto got_foot_unit
if ($get_units_arg1 == "TMALSK9F83") then goto got_foot_unit
if ($get_units_arg1 == "TMARIZCF") then goto got_foot_unit
if ($get_units_arg1 == "TMARIZCF83") then goto got_foot_unit
if ($get_units_arg1 == "TMARIZEF") then goto got_foot_unit
if ($get_units_arg1 == "TMARIZEF83") then goto got_foot_unit
if ($get_units_arg1 == "TMARIZWF") then goto got_foot_unit
if ($get_units_arg1 == "TMARIZWF83") then goto got_foot_unit
if ($get_units_arg1 == "TMDELWRF") then goto got_foot_unit
if ($get_units_arg1 == "TMDELWRF83") then goto got_foot_unit
if ($get_units_arg1 == "TMFLRAEF") then goto got_foot_unit
if ($get_units_arg1 == "TMFLRAEF83") then goto got_foot_unit
if ($get_units_arg1 == "TMFLRAWF") then goto got_foot_unit
if ($get_units_arg1 == "TMFLRAWF83") then goto got_foot_unit
if ($get_units_arg1 == "TMGCWEG2") then goto got_foot_unit
if ($get_units_arg1 == "TMGEOREF") then goto got_foot_unit
if ($get_units_arg1 == "TMGEOREF83") then goto got_foot_unit
if ($get_units_arg1 == "TMGEORWF") then goto got_foot_unit
if ($get_units_arg1 == "TMGEORWF83") then goto got_foot_unit
if ($get_units_arg1 == "TMGHANAF") then goto got_foot_unit
if ($get_units_arg1 == "TMHAWI1F") then goto got_foot_unit
if ($get_units_arg1 == "TMHAWI1F83") then goto got_foot_unit
if ($get_units_arg1 == "TMHAWI2F") then goto got_foot_unit
if ($get_units_arg1 == "TMHAWI2F83") then goto got_foot_unit
if ($get_units_arg1 == "TMHAWI3F") then goto got_foot_unit
if ($get_units_arg1 == "TMHAWI3F83") then goto got_foot_unit
if ($get_units_arg1 == "TMHAWI4F") then goto got_foot_unit
if ($get_units_arg1 == "TMHAWI4F83") then goto got_foot_unit
if ($get_units_arg1 == "TMHAWI5F") then goto got_foot_unit
if ($get_units_arg1 == "TMHAWI5F83") then goto got_foot_unit
if ($get_units_arg1 == "TMIDACFT") then goto got_foot_unit
if ($get_units_arg1 == "TMIDACFT83") then goto got_foot_unit
if ($get_units_arg1 == "TMIDAEFT") then goto got_foot_unit
if ($get_units_arg1 == "TMIDAEFT83") then goto got_foot_unit
if ($get_units_arg1 == "TMIDAWFT") then goto got_foot_unit
if ($get_units_arg1 == "TMIDAWFT83") then goto got_foot_unit
if ($get_units_arg1 == "TMILLEFT") then goto got_foot_unit
if ($get_units_arg1 == "TMILLEFT83") then goto got_foot_unit
if ($get_units_arg1 == "TMILLWFT") then goto got_foot_unit
if ($get_units_arg1 == "TMILLWFT83") then goto got_foot_unit
if ($get_units_arg1 == "TMINDEFT") then goto got_foot_unit
if ($get_units_arg1 == "TMINDEFT83") then goto got_foot_unit
if ($get_units_arg1 == "TMINDWFT") then goto got_foot_unit
if ($get_units_arg1 == "TMINDWFT83") then goto got_foot_unit
if ($get_units_arg1 == "TMMAINEF") then goto got_foot_unit
if ($get_units_arg1 == "TMMAINEF83") then goto got_foot_unit
if ($get_units_arg1 == "TMMAINWF") then goto got_foot_unit
if ($get_units_arg1 == "TMMAINWF83") then goto got_foot_unit
if ($get_units_arg1 == "TMMICHCF") then goto got_foot_unit
if ($get_units_arg1 == "TMMICHEF") then goto got_foot_unit
if ($get_units_arg1 == "TMMICHWF") then goto got_foot_unit
if ($get_units_arg1 == "TMMISOCF") then goto got_foot_unit
if ($get_units_arg1 == "TMMISOCF83") then goto got_foot_unit
if ($get_units_arg1 == "TMMISOEF") then goto got_foot_unit
if ($get_units_arg1 == "TMMISOEF83") then goto got_foot_unit
if ($get_units_arg1 == "TMMISOWF") then goto got_foot_unit
if ($get_units_arg1 == "TMMISOWF83") then goto got_foot_unit
if ($get_units_arg1 == "TMMISSEF") then goto got_foot_unit
if ($get_units_arg1 == "TMMISSEF83") then goto got_foot_unit
if ($get_units_arg1 == "TMMISSWF") then goto got_foot_unit
if ($get_units_arg1 == "TMMISSWF83") then goto got_foot_unit
if ($get_units_arg1 == "TMNEVACF") then goto got_foot_unit
if ($get_units_arg1 == "TMNEVACF83") then goto got_foot_unit
if ($get_units_arg1 == "TMNEVAEF") then goto got_foot_unit
if ($get_units_arg1 == "TMNEVAEF83") then goto got_foot_unit
if ($get_units_arg1 == "TMNEVAWF") then goto got_foot_unit
if ($get_units_arg1 == "TMNEVAWF83") then goto got_foot_unit
if ($get_units_arg1 == "TMNEWHFT") then goto got_foot_unit
if ($get_units_arg1 == "TMNEWHFT83") then goto got_foot_unit
if ($get_units_arg1 == "TMNEWJFT") then goto got_foot_unit
if ($get_units_arg1 == "TMNEWJFT83") then goto got_foot_unit
if ($get_units_arg1 == "TMNEWMCF") then goto got_foot_unit
if ($get_units_arg1 == "TMNEWMCF83") then goto got_foot_unit
if ($get_units_arg1 == "TMNEWMEF") then goto got_foot_unit
if ($get_units_arg1 == "TMNEWMEF83") then goto got_foot_unit
if ($get_units_arg1 == "TMNEWMWF") then goto got_foot_unit
if ($get_units_arg1 == "TMNEWMWF83") then goto got_foot_unit
if ($get_units_arg1 == "TMNEWYCF") then goto got_foot_unit
if ($get_units_arg1 == "TMNEWYCF83") then goto got_foot_unit
if ($get_units_arg1 == "TMNEWYEF") then goto got_foot_unit
if ($get_units_arg1 == "TMNEWYEF83") then goto got_foot_unit
if ($get_units_arg1 == "TMNEWYWF") then goto got_foot_unit
if ($get_units_arg1 == "TMNEWYWF83") then goto got_foot_unit
if ($get_units_arg1 == "TMRHODIF") then goto got_foot_unit
if ($get_units_arg1 == "TMRHODIF83") then goto got_foot_unit
if ($get_units_arg1 == "TMVERMTF") then goto got_foot_unit
if ($get_units_arg1 == "TMVERMTF83") then goto got_foot_unit
if ($get_units_arg1 == "TMWYO1FT") then goto got_foot_unit
if ($get_units_arg1 == "TMWYO2FT") then goto got_foot_unit
if ($get_units_arg1 == "TMWYO3FT") then goto got_foot_unit
if ($get_units_arg1 == "TMWYO4FT") then goto got_foot_unit
if ($get_units_arg1 == "TMWTOECF83") then goto got_foot_unit
if ($get_units_arg1 == "TMWYOE83") then goto got_foot_unit
if ($get_units_arg1 == "TMWYOWCF83") then goto got_foot_unit
if ($get_units_arg1 == "TMWYOWF83") then goto got_foot_unit

$units_return = "Meters"
goto exit_out

got_foot_unit:
$units_return = "Feet"
goto exit_out

got_dd_units:
$units_return = "Decimal Degrees"

exit_out:
