CFLib.org – Common Function Library Project

UTMLetterDesignator(lat)

Last updated January 26, 2006

author

Wayne Graham

Version: 1 | Requires: CF5 | Library: UtilityLib

Description:
Determines the correct UTM letter designator for a given latitude; returns Z if latitude is outside UTM limits of 84N to 80S.

Return Values:
Returns a string.

Example:

<cfoutput>#UTMLetterDesignator(37.268946)#</cfoutput>

Parameters:

Name Description Required
lat Latitude. Yes

Full UDF Source:

/**
 * Determines the correct UTM letter designator for a given latitude.
 * 
 * @param lat      Latitude. (Required)
 * @return Returns a string. 
 * @author Wayne Graham (wsgrah@wm.edu) 
 * @version 1, January 26, 2006 
 */
function UTMLetterDesignator(lat){
    var UTMLetter = "Z";
            
    if(84 GTE lat AND lat GTE 72) UTMLetter = "X";
    else if(72 GT lat AND lat GTE 64) UTMLetter = "W";
    else if(64 GT lat AND lat GTE 56) UTMLetter = "V";
    else if (56 GT lat AND lat GTE 48) UTMLetter = "U";
    else if (48 GT lat AND lat GTE 40) UTMLetter = "T";
    else if (40 GT lat AND lat GTE 32) UTMLetter = "S";
    else if (32 GT lat AND lat GTE 24) UTMLetter = "R";
    else if (24 GT lat AND lat GTE 16) UTMLetter = "Q";
    else if (16 GT lat AND lat GTE 8) UTMLetter = "P";
    else if (8 GT lat AND lat GTE 0) UTMLetter = "N";
    else if (0 GT lat AND lat GTE -8) UTMLetter = "M";
    else if (-8 GT lat AND lat GTE -16) UTMLetter = "L";
    else if (-16 GT lat AND lat GTE -32) UTMLetter = "K";
    else if (-32 GT lat AND lat GTE -40) UTMLetter = "J";
    else if (-40 GT lat AND lat GTE -48) UTMLetter = "H";
    else if (-48 GT lat AND lat GTE -56) UTMLetter = "G";
    else if (-56 GT lat AND lat GTE -64) UTMLetter = "F";
    else if (-64 GT lat AND lat GTE -72) UTMLetter = "E";
    else if (-72 GT lat AND lat GTE -80) UTMLetter = "C";
    return UTMLetter;
}

Search CFLib.org


Latest Additions

Raymond Camden added
QueryDeleteRows
November 04, 2017

Leigh added
nullPad
May 11, 2016

Raymond Camden added
stripHTML
May 10, 2016

Kevin Cotton added
date2ExcelDate
May 05, 2016

Raymond Camden added
CapFirst
April 25, 2016

Created by Raymond Camden / Design by Justin Johnson