# Y:/msp/devkits/temp_geotrans/master/geotrans3.1/CCS/src/dtcc/CoordinateSystems/usng/USNG.cpp File Reference

`#include <ctype.h>`
`#include <math.h>`
`#include <string.h>`
`#include "UPS.h"`
`#include "UTM.h"`
`#include "USNG.h"`
`#include "EllipsoidParameters.h"`
`#include "MGRSorUSNGCoordinates.h"`
`#include "GeodeticCoordinates.h"`
`#include "UPSCoordinates.h"`
`#include "UTMCoordinates.h"`
`#include "CoordinateConversionException.h"`
`#include "ErrorMessages.h"`
`#include "WarningMessages.h"`

Go to the source code of this file.

## Classes

struct | Latitude_Band
struct | UPS_Constant

## Defines

#define | EPSILON 1.75e-7
#define | _500000 500000.0

## Functions

long | roundUSNG (double value)
void | makeUSNGString (char *USNGString, long zone, int letters[USNG_LETTERS], double easting, double northing, long precision)
void | breakUSNGString (char *USNGString, long *zone, long letters[USNG_LETTERS], double *easting, double *northing, long *precision)

## Variables

const int | LETTER_A = 0
const int | LETTER_B = 1
const int | LETTER_C = 2
const int | LETTER_D = 3
const int | LETTER_E = 4
const int | LETTER_F = 5
const int | LETTER_G = 6
const int | LETTER_H = 7
const int | LETTER_I = 8
const int | LETTER_J = 9
const int | LETTER_K = 10
const int | LETTER_L = 11
const int | LETTER_M = 12
const int | LETTER_N = 13
const int | LETTER_O = 14
const int | LETTER_P = 15
const int | LETTER_Q = 16
const int | LETTER_R = 17
const int | LETTER_S = 18
const int | LETTER_T = 19
const int | LETTER_U = 20
const int | LETTER_V = 21
const int | LETTER_W = 22
const int | LETTER_X = 23
const int | LETTER_Y = 24
const int | LETTER_Z = 25
const double | ONEHT = 100000.e0
const double | TWOMIL = 2000000.e0
const int | TRUE = 1
const int | FALSE = 0
const double | PI = 3.14159265358979323e0
const double | PI_OVER_2 = (PI / 2.0e0)
const double | PI_OVER_180 = (PI / 180.0e0)
const double | MIN_EASTING = 100000.0
const double | MAX_EASTING = 900000.0
const double | MIN_NORTHING = 0.0
const double | MAX_NORTHING = 10000000.0
const int | MAX_PRECISION = 5
const double | MIN_USNG_NON_POLAR_LAT = -80.0 * ( PI / 180.0 )
const double | MAX_USNG_NON_POLAR_LAT = 84.0 * ( PI / 180.0 )
const double | MIN_EAST_NORTH = 0.0
const double | MAX_EAST_NORTH = 3999999.0
const double | _6 = (6.0 * (PI / 180.0))
const double | _8 = (8.0 * (PI / 180.0))
const double | _72 = (72.0 * (PI / 180.0))
const double | _80 = (80.0 * (PI / 180.0))
const double | _80_5 = (80.5 * (PI / 180.0))
const double | _84_5 = (84.5 * (PI / 180.0))
const Latitude_Band | Latitude_Band_Table [20]
const UPS_Constant | UPS_Constant_Table [4]

## Define Documentation

#define _500000 500000.0

Definition at line 175 of file USNG.cpp.

#define EPSILON 1.75e-7

Definition at line 121 of file USNG.cpp.

## Function Documentation

void breakUSNGString | ( | char * | USNGString,
|  | long * | zone,
|  | long | letters[USNG_LETTERS],
|  | double * | easting,
|  | double * | northing,
|  | long * | precision |
| ) |  |  |

Definition at line 294 of file USNG.cpp.

void makeUSNGString | ( | char * | USNGString,
|  | long | zone,
|  | int | letters[USNG_LETTERS],
|  | double | easting,
|  | double | northing,
|  | long | precision |
| ) |  |  |

Definition at line 251 of file USNG.cpp.

long roundUSNG | ( | double | value | ) |

Definition at line 231 of file USNG.cpp.

## Variable Documentation

const double _6 = (6.0 * (PI / 180.0))

Definition at line 168 of file USNG.cpp.

const double _72 = (72.0 * (PI / 180.0))

Definition at line 170 of file USNG.cpp.

const double _8 = (8.0 * (PI / 180.0))

Definition at line 169 of file USNG.cpp.

const double _80 = (80.0 * (PI / 180.0))

Definition at line 171 of file USNG.cpp.

const double _80_5 = (80.5 * (PI / 180.0))

Definition at line 172 of file USNG.cpp.

const double _84_5 = (84.5 * (PI / 180.0))

Definition at line 173 of file USNG.cpp.

const int FALSE = 0

Definition at line 152 of file USNG.cpp.

const Latitude_Band Latitude_Band_Table[20]

Initial value:

      {{LETTER_C, 1100000.0, -72.0, -80.5, 0.0},
      {LETTER_D, 2000000.0, -64.0, -72.0, 2000000.0},
      {LETTER_E, 2800000.0, -56.0, -64.0, 2000000.0},
      {LETTER_F, 3700000.0, -48.0, -56.0, 2000000.0},
      {LETTER_G, 4600000.0, -40.0, -48.0, 4000000.0},
      {LETTER_H, 5500000.0, -32.0, -40.0, 4000000.0},
      {LETTER_J, 6400000.0, -24.0, -32.0, 6000000.0},
      {LETTER_K, 7300000.0, -16.0, -24.0, 6000000.0},
      {LETTER_L, 8200000.0, -8.0, -16.0, 8000000.0},
      {LETTER_M, 9100000.0, 0.0, -8.0, 8000000.0},
      {LETTER_N, 0.0, 8.0, 0.0, 0.0},
      {LETTER_P, 800000.0, 16.0, 8.0, 0.0},
      {LETTER_Q, 1700000.0, 24.0, 16.0, 0.0},
      {LETTER_R, 2600000.0, 32.0, 24.0, 2000000.0},
      {LETTER_S, 3500000.0, 40.0, 32.0, 2000000.0},
      {LETTER_T, 4400000.0, 48.0, 40.0, 4000000.0},
      {LETTER_U, 5300000.0, 56.0, 48.0, 4000000.0},
      {LETTER_V, 6200000.0, 64.0, 56.0, 6000000.0},
      {LETTER_W, 7000000.0, 72.0, 64.0, 6000000.0},
      {LETTER_X, 7900000.0, 84.5, 72.0, 6000000.0}}

Definition at line 186 of file USNG.cpp.

const int LETTER_A = 0

Definition at line 123 of file USNG.cpp.

const int LETTER_B = 1

Definition at line 124 of file USNG.cpp.

const int LETTER_C = 2

Definition at line 125 of file USNG.cpp.

const int LETTER_D = 3

Definition at line 126 of file USNG.cpp.

const int LETTER_E = 4

Definition at line 127 of file USNG.cpp.

const int LETTER_F = 5

Definition at line 128 of file USNG.cpp.

const int LETTER_G = 6

Definition at line 129 of file USNG.cpp.

const int LETTER_H = 7

Definition at line 130 of file USNG.cpp.

const int LETTER_I = 8

Definition at line 131 of file USNG.cpp.

const int LETTER_J = 9

Definition at line 132 of file USNG.cpp.

const int LETTER_K = 10

Definition at line 133 of file USNG.cpp.

const int LETTER_L = 11

Definition at line 134 of file USNG.cpp.

const int LETTER_M = 12

Definition at line 135 of file USNG.cpp.

const int LETTER_N = 13

Definition at line 136 of file USNG.cpp.

const int LETTER_O = 14

Definition at line 137 of file USNG.cpp.

const int LETTER_P = 15

Definition at line 138 of file USNG.cpp.

const int LETTER_Q = 16

Definition at line 139 of file USNG.cpp.

const int LETTER_R = 17

Definition at line 140 of file USNG.cpp.

const int LETTER_S = 18

Definition at line 141 of file USNG.cpp.

const int LETTER_T = 19

Definition at line 142 of file USNG.cpp.

const int LETTER_U = 20

Definition at line 143 of file USNG.cpp.

const int LETTER_V = 21

Definition at line 144 of file USNG.cpp.

const int LETTER_W = 22

Definition at line 145 of file USNG.cpp.

const int LETTER_X = 23

Definition at line 146 of file USNG.cpp.

const int LETTER_Y = 24

Definition at line 147 of file USNG.cpp.

const int LETTER_Z = 25

Definition at line 148 of file USNG.cpp.

const double MAX_EAST_NORTH = 3999999.0

Definition at line 166 of file USNG.cpp.

const double MAX_EASTING = 900000.0

Definition at line 158 of file USNG.cpp.

const double MAX_NORTHING = 10000000.0

Definition at line 160 of file USNG.cpp.

const int MAX_PRECISION = 5

Definition at line 161 of file USNG.cpp.

const double MAX_USNG_NON_POLAR_LAT = 84.0 * ( PI / 180.0 )

Definition at line 163 of file USNG.cpp.

const double MIN_EAST_NORTH = 0.0

Definition at line 165 of file USNG.cpp.

const double MIN_EASTING = 100000.0

Definition at line 157 of file USNG.cpp.

const double MIN_NORTHING = 0.0

Definition at line 159 of file USNG.cpp.

const double MIN_USNG_NON_POLAR_LAT = -80.0 * ( PI / 180.0 )

Definition at line 162 of file USNG.cpp.

const double ONEHT = 100000.e0

Definition at line 149 of file USNG.cpp.

const double PI = 3.14159265358979323e0

Definition at line 153 of file USNG.cpp.

const double PI_OVER_180 = (PI / 180.0e0)

Definition at line 155 of file USNG.cpp.

const double PI_OVER_2 = (PI / 2.0e0)

Definition at line 154 of file USNG.cpp.

const int TRUE = 1

Definition at line 151 of file USNG.cpp.

const double TWOMIL = 2000000.e0

Definition at line 150 of file USNG.cpp.

const UPS_Constant UPS_Constant_Table[4]

Initial value:

      {{LETTER_A, LETTER_J, LETTER_Z, LETTER_Z, 800000.0, 800000.0},
      {LETTER_B, LETTER_A, LETTER_R, LETTER_Z, 2000000.0, 800000.0},
      {LETTER_Y, LETTER_J, LETTER_Z, LETTER_P, 800000.0, 1300000.0},
      {LETTER_Z, LETTER_A, LETTER_J, LETTER_P, 2000000.0, 1300000.0}}

Definition at line 219 of file USNG.cpp.