Other#
Distance Calculation#
Any point on the Earth’s surface can be located by its latitude and longitude coordinates. Latitude is the angle above or below the equator in degrees. The equator is zero degrees, the North pole is north 90 degrees latitude, and the South pole is South 90 degrees latitude. The continental United States falls between 25 and 50 degrees North.
Longitude is the angle East or West of the Greenwich meridian. The continental United States is between 70 and 125 degrees West.
Approximate Solutions#
One degree of latitude is equal to 69.1 miles. One degree of longitude is equal to 69.1 miles at the equator. North or South of the equator, 1 degree of longitude is a smaller distance. It’s reduced by the cosine of the latitude. Dividing the latitude number by 57.3 converts it to radians.
If you don’t want to use the COS function, then a good approximate solution is:
Exact Solution#
To calculate the exact distance between points requires spherical geometry.
The basic formula is:
The above formula has one major problem: most computer languages do not support the arccosine function. Therefore a different form is necessary, one that uses the arctangent function that most languages embrace.
where A is equal to:
Most computer languages compute the sine and cosine function with the angle given in radians. To convert degrees to radians, divide degrees by the constant:
In BASIC this would be programmed as follows:
Where:
D = distance in statue miles from the first to the second point.
C = degrees to radians constant 57.3.
Lat1 = latitude of the first point in degrees.
Long1 = longitude of the first point in degrees.
Lat2 = latitude of the second point in degrees.
Long2 = longitude of the second point in degrees.
NOTE: Dividing the latitude number by 57.3 converts it to radians.
Since all ZIP Code points in the United States are North latitude and West longitude, there is no need to check the sines (positive and negative) of the latitudes and longitudes.
Some programming languages, such as dBASE II/III, do not have the functions of the sine, cosine and arctangent. Also, the formulas given are time-consuming to calculate. A simpler but less accurate method is given here:
Although this formula is not as accurate as the first great circle method, it will give good results for most applications.
In basic, it is written as follows:
In dBASE III, it is written as follows:
To make using the database easier, the latitudes and longitudes are given in the decimal format instead of the degree, minute and second format. The latter would require the additional steps of converting seconds to fractions of a minute and then minutes to a fraction of a degree.
Bearing Formula#
The bearing is the direction from the first point to the second point. It is expressed as an angle from North in degrees. Due North is a bearing of zero degrees, East is a bearing of 90 degrees, South is 180, and west is 270.
The bearing from the first point to the second is calculated with:
Since the ARCTAN function gives the angle in radians, it is necessary to convert B to degrees by multiplying by
To use this equation requires some special considerations. This example assumes that Lat1, Lat2, Long1, Long2 have been converted to radians.
Use the following steps:
If (D > 0) then (B = 360 + B)
If (D < 0) then (B = 180 + B)
If (B < 0) then (B = 360 + B)
Where:
N is the Numerator.
D is the Denominator.
B is the Bearing.
Examples#
The following examples should give you a feel for the numbers. For these examples, we will use the points of Schenectady, NY and Los Angeles, CA.
First Point is in Schenectady, NY, 12345
Lat1 = 42.8145
Long1 = 73.9380
Second Point is in Los Angeles, CA, 90001
Lat1 = 34.0515
Long1 = 118.2420
Example 1: Approximate Formula
Example 2: Approximate Formula
Example 3: Exact Solution Formula
Example 4: Bearing Formula
LATAs#
United States LATAs#
Code |
State |
Code |
State |
---|---|---|---|
120 |
Maine |
222 |
Delaware Valley, NJ |
122 |
New Hampshire |
224 |
North Jersey, NJ |
124 |
Vermont |
226 |
Capital, PA |
126 |
Western Mass |
228 |
Philadelphia, PA |
128 |
Eastern Mass |
230 |
Altoona, PA |
130 |
Rhode Island |
232 |
Northeast, PA |
132 |
New York, NY |
234 |
Pittsburgh, PA |
133 |
Poughkeepsie, NY |
236 |
Washington DC |
134 |
Albany, NY |
238 |
Baltimore, MD |
136 |
Syracuse, NY |
240 |
Hagerstown, MD |
138 |
Binghamton, NY |
242 |
Salisbury, MD |
140 |
Buffalo, NY |
244 |
Roanoke, VA |
220 |
Atlantic Coastal, NJ |
246 |
Culpeper, VA |
248 |
Richmond, VA |
428 |
Wilmington, NC |
250 |
Lynchburg, VA |
430 |
Greenville, SC |
252 |
Norfolk, VA |
432 |
Florence, SC |
254 |
Charleston, WV |
434 |
Columbia, SC |
256 |
Clarksburg, WV |
436 |
Charleston, SC |
320 |
Cleveland, OH |
438 |
Atlanta, GA |
322 |
Youngstown, OH |
440 |
Savannah, GA |
324 |
Columbus, OH |
442 |
Augusta, GA |
325 |
Akron, OH |
444 |
Albany, GA |
326 |
Toledo, OH |
446 |
Macon, GA |
328 |
Dayton, OH |
448 |
Pensacola, FL |
330 |
Evansville, IN |
450 |
Panama City, FL |
332 |
South Bend, IN |
452 |
Jacksonville, FL |
334 |
Auburn/Huntington, IN |
454 |
Gainesville, FL |
336 |
Indianapolis, IN |
456 |
Daytona Beach, FL |
338 |
Bloomington, IN |
458 |
Orlando, FL |
340 |
Detroit, MI |
460 |
Southeast FL |
342 |
Upper Peninsula MI |
462 |
Louisville, KY |
344 |
Saginaw, MI |
464 |
Owensboro, KY |
346 |
Lansing, MI |
466 |
Winchester, KY |
348 |
Grand Rapids, MI |
468 |
Memphis, TN |
350 |
Northeast WI |
470 |
Nashville, TN |
352 |
Northwest WI |
472 |
Chattanooga, TN |
354 |
Southwest WI |
474 |
Knoxville, TN |
356 |
Southeast WI |
476 |
Birmingham, AL |
358 |
Chicago, IL |
477 |
Huntsville, AL |
360 |
Rockford, IL |
478 |
Montgomery, AL |
362 |
Cairo, IL |
480 |
Mobile, AL |
364 |
Sterling, IL |
482 |
Jackson, MS |
366 |
Forrest, IL |
484 |
Biloxi, MS |
368 |
Peoria, IL |
486 |
Shreveport, LA |
370 |
Champaign, IL |
488 |
Lafayette, LA |
374 |
Springfield, IL |
490 |
New Orleans, LA |
376 |
Quincy, IL |
492 |
Baton Rouge, LA |
420 |
Asheville, NC |
520 |
St Louis, MO |
422 |
Charlotte, NC |
521 |
Westphalia, MO |
424 |
Greensboro, NC |
522 |
Springfield, MO |
426 |
Raleigh, NC |
524 |
Kansas City, MO |
526 |
Fort Smith, AK |
652 |
Idaho |
528 |
Little Rock, AK |
654 |
Wyoming |
530 |
Pine Bluff, AK |
656 |
Denver, CO |
532 |
Wichita, KS |
658 |
Colorado Springs, CO |
534 |
Topeka, KS |
660 |
Utah |
536 |
Oklahoma City, OK |
664 |
New Mexico |
538 |
Tulsa, OK |
666 |
Phoenix, AZ |
540 |
El Paso, TX |
668 |
Tucson, AZ |
542 |
Midland, TX |
670 |
Eugene, OR |
544 |
Lubbock, TX |
672 |
Portland, OR |
546 |
Amarillo, TX |
674 |
Seattle, WA |
548 |
Wichita Falls, TX |
676 |
Spokane, WA |
550 |
Abilene, TX |
720 |
Reno, NV |
552 |
Dallas, TX |
721 |
Pahrump, NV |
554 |
Longview, TX |
722 |
San Francisco, CA |
556 |
Waco, TX |
724 |
Chico, CA |
558 |
Austin, TX |
726 |
Sacramento, CA |
560 |
Houston, TX |
728 |
Fresno, CA |
562 |
Beaumont, TX |
730 |
Los Angeles, CA |
564 |
Corpus Christi, TX |
732 |
San Diego, CA |
566 |
San Antonio, TX |
734 |
Bakersfield, CA |
568 |
Brownsville, TX |
736 |
Monterey, CA |
570 |
Hearne, TX |
738 |
Stockton, CA |
620 |
Rochester, MN |
740 |
San Luis Obispo, CA |
624 |
Duluth, MN |
832 |
Alaska |
626 |
St Cloud, MN |
834 |
Hawaii |
628 |
Minneapolis, MN |
920 |
Connecticut |
630 |
Sioux City, IA |
921 |
Fishers Island, NY |
632 |
Des Moines, IA |
922 |
Cincinnati, OH |
634 |
Davenport, IA |
923 |
Lima/Mansfield, OH |
635 |
Cedar Rapids, IA |
924 |
Erie, PA |
636 |
Brainerd/Fargo, ND |
927 |
Harrisonburg, VA |
638 |
Bismark, ND |
928 |
Charlottesville, VA |
640 |
South Dakota |
929 |
Eninburg, VA |
644 |
Omaha, NE |
932 |
Blue Field, WV |
646 |
Grand Island, NE |
937 |
Richmond, IN |
648 |
Great Falls, MT |
938 |
Terre Haute, IN |
650 |
Billings, MT |
939 |
Fort Myers, FL |
949 |
Fayetteville, NC |
963 |
Kalispell, MT |
951 |
Rocky Mount, |
973 |
Palm Springs, CA |
952 |
Tampa, FL |
974 |
Rochester, NY |
953 |
Tallahassee, FL |
976 |
Mattoon, IL |
956 |
Bristol/Johnson, TN |
977 |
Macomb, IL |
958 |
Lincoln, NE |
978 |
Olney, IL |
960 |
Couer D’Alene, ID |
980 |
Navajo Territory, AZ |
961 |
San Angelo, TX |
981 |
Navajo Territory, UT |
Canadian LATAs#
Code |
State |
---|---|
850 |
Quebec |
851 |
Ontario |
881 |
Alberta |
883 |
Quebec |
884 |
Alberta |
885 |
Newfoundland |
886 |
British Columbia |
887 |
Nova Scotia/Prince Edward |
888 |
Manitoba |
889 |
Nova Scotia/Prince Edward |
890 |
New Brunswick |
891 |
Saskatchewan |
892 |
Yukon |
Caribbean LATAs#
Code |
State |
---|---|
820 |
Puerto Rico |
822 |
Virgin Islands |
824 |
Bahamas |
826 |
Jamaica |
828 |
Dominican Republic |
830 |
Other Caribbean Islands |
Additional LATAs#
Code |
State |
---|---|
838 |
Mexico |
870 |
Mariana Islands |
871 |
Guam |
State Abbreviations and Codes#
Abbreviation |
Code |
State |
---|---|---|
AL |
01 |
Alabama |
AK |
02 |
Alaska |
AZ |
04 |
Arizona |
AR |
05 |
Arkansas |
CA |
06 |
California |
CO |
08 |
Colorado |
CT |
09 |
Connecticut |
DE |
10 |
Delaware |
DC |
11 |
District of Columbia |
FL |
12 |
Florida |
GA |
13 |
Georgia |
HI |
15 |
Hawaii |
ID |
16 |
Idaho |
IL |
17 |
Illinois |
IN |
18 |
Indiana |
IA |
19 |
Iowa |
KS |
20 |
Kansas |
KY |
21 |
Kentucky |
LA |
22 |
Louisiana |
ME |
23 |
Maine |
MD |
24 |
Maryland |
MA |
25 |
Massachusetts |
MI |
26 |
Michigan |
MN |
27 |
Minnesota |
MS |
28 |
Mississippi |
MO |
29 |
Missouri |
MT |
30 |
Montana |
NE |
31 |
Nebraska |
NV |
32 |
Nevada |
NH |
33 |
New Hampshire |
NJ |
34 |
New Jersey |
NM |
35 |
New Mexico |
NY |
36 |
New York |
NC |
37 |
North Carolina |
ND |
38 |
North Dakota |
OH |
39 |
Ohio |
OK |
40 |
Oklahoma |
OR |
41 |
Oregon |
PA |
42 |
Pennsylvania |
RI |
44 |
Rhode Island |
SC |
45 |
South Carolina |
SD |
46 |
South Dakota |
TN |
47 |
Tennessee |
TX |
48 |
Texas |
UT |
49 |
Utah |
VT |
50 |
Vermont |
VA |
51 |
Virginia |
WA |
53 |
Washington |
WV |
54 |
West Virginia |
WI |
55 |
Wisconsin |
WY |
56 |
Wyoming |
AS |
60 |
American Samoa |
FM |
64 |
Micronesia |
GU |
66 |
Guam |
MH |
68 |
Marshall Islands |
MP |
69 |
N.Mariana Islands |
PW |
70 |
Palau |
PR |
72 |
Puerto Rico |
UM |
74 |
Minor Islands |
VI |
78 |
Virgin Islands |
Canadian Abbreviations and Provinces#
Abbreviation |
Province |
---|---|
BC |
British Columbia |
NB |
New Brunswick |
NL |
Newfoundland |
NS |
Nova Scotia |
NT |
Northwest Territories |
NU |
Nunavut |
PE |
Prince Edward Island |
AB |
Province of Alberta |
MB |
Province of Manitoba |
ON |
Province of Ontario |
QC |
Province of Quebec |
SK |
Province of Saskatchewan |
YT |
Yukon Territories |
Release Schedule#
Release Date Schedule |
|
---|---|
2024-10-21 |
|
2025-01-27 |
|
2025-04-21 |
|
2025-07-21 |
|
2025-10-27 |