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;
}
blog comments powered by Disqus

Search CFLib.org


Latest Additions

Kevin Cotton added
date2ExcelDate
May 5, 2016

Raymond Camden added
CapFirst
April 25, 2016

Chris Wigginton added
loremIpsum
January 18, 2016

Gary Stanton added
calculateArrival...
November 19, 2015

Sebastiaan Naafs - van Dijk added
getDaysInQuarter
November 13, 2015

Created by Raymond Camden / Design by Justin Johnson