|
dRonin
adbada4
dRonin firmware
|
#include <ctype.h>#include <math.h>#include <stdio.h>#include <string.h>#include "ups.h"#include "utm.h"#include "mgrs.h"Go to the source code of this file.
Data Structures | |
| struct | Latitude_Band_Value |
| struct | UPS_Constant_Value |
Macros | |
| #define | DEG_TO_RAD 0.017453292519943295 /* PI/180 */ |
| #define | RAD_TO_DEG 57.29577951308232087 /* 180/PI */ |
| #define | LETTER_A 0 /* ARRAY INDEX FOR LETTER A */ |
| #define | LETTER_B 1 /* ARRAY INDEX FOR LETTER B */ |
| #define | LETTER_C 2 /* ARRAY INDEX FOR LETTER C */ |
| #define | LETTER_D 3 /* ARRAY INDEX FOR LETTER D */ |
| #define | LETTER_E 4 /* ARRAY INDEX FOR LETTER E */ |
| #define | LETTER_F 5 /* ARRAY INDEX FOR LETTER F */ |
| #define | LETTER_G 6 /* ARRAY INDEX FOR LETTER G */ |
| #define | LETTER_H 7 /* ARRAY INDEX FOR LETTER H */ |
| #define | LETTER_I 8 /* ARRAY INDEX FOR LETTER I */ |
| #define | LETTER_J 9 /* ARRAY INDEX FOR LETTER J */ |
| #define | LETTER_K 10 /* ARRAY INDEX FOR LETTER K */ |
| #define | LETTER_L 11 /* ARRAY INDEX FOR LETTER L */ |
| #define | LETTER_M 12 /* ARRAY INDEX FOR LETTER M */ |
| #define | LETTER_N 13 /* ARRAY INDEX FOR LETTER N */ |
| #define | LETTER_O 14 /* ARRAY INDEX FOR LETTER O */ |
| #define | LETTER_P 15 /* ARRAY INDEX FOR LETTER P */ |
| #define | LETTER_Q 16 /* ARRAY INDEX FOR LETTER Q */ |
| #define | LETTER_R 17 /* ARRAY INDEX FOR LETTER R */ |
| #define | LETTER_S 18 /* ARRAY INDEX FOR LETTER S */ |
| #define | LETTER_T 19 /* ARRAY INDEX FOR LETTER T */ |
| #define | LETTER_U 20 /* ARRAY INDEX FOR LETTER U */ |
| #define | LETTER_V 21 /* ARRAY INDEX FOR LETTER V */ |
| #define | LETTER_W 22 /* ARRAY INDEX FOR LETTER W */ |
| #define | LETTER_X 23 /* ARRAY INDEX FOR LETTER X */ |
| #define | LETTER_Y 24 /* ARRAY INDEX FOR LETTER Y */ |
| #define | LETTER_Z 25 /* ARRAY INDEX FOR LETTER Z */ |
| #define | MGRS_LETTERS 3 /* NUMBER OF LETTERS IN MGRS */ |
| #define | ONEHT 100000.e0 /* ONE HUNDRED THOUSAND */ |
| #define | TWOMIL 2000000.e0 /* TWO MILLION */ |
| #define | TRUE 1 /* CONSTANT VALUE FOR TRUE VALUE */ |
| #define | FALSE 0 /* CONSTANT VALUE FOR FALSE VALUE */ |
| #define | PI 3.14159265358979323e0 /* PI */ |
| #define | PI_OVER_2 (PI / 2.0e0) |
| #define | MIN_EASTING 100000 |
| #define | MAX_EASTING 900000 |
| #define | MIN_NORTHING 0 |
| #define | MAX_NORTHING 10000000 |
| #define | MAX_PRECISION 5 /* Maximum precision of easting & northing */ |
| #define | MIN_UTM_LAT ( (-80 * PI) / 180.0 ) /* -80 degrees in radians */ |
| #define | MAX_UTM_LAT ( (84 * PI) / 180.0 ) /* 84 degrees in radians */ |
| #define | MIN_EAST_NORTH 0 |
| #define | MAX_EAST_NORTH 4000000 |
Typedefs | |
| typedef struct Latitude_Band_Value | Latitude_Band |
| typedef struct UPS_Constant_Value | UPS_Constant |
Functions | |
| int | Get_Latitude_Band_Min_Northing (int letter, double *min_northing, double *northing_offset) |
| int | Get_Latitude_Range (int letter, double *north, double *south) |
| int | Get_Latitude_Letter (double latitude, int *letter) |
| int | Check_Zone (char *MGRS, int *zone_exists) |
| int | Round_MGRS (double value) |
| int | Make_MGRS_String (char *MGRS, int Zone, int Letters[MGRS_LETTERS], double Easting, double Northing, int Precision) |
| int | Break_MGRS_String (char *MGRS, int *Zone, int Letters[MGRS_LETTERS], double *Easting, double *Northing, int *Precision) |
| void | Get_Grid_Values (int zone, int *ltr2_low_value, int *ltr2_high_value, double *pattern_offset) |
| int | UTM_To_MGRS (int Zone, char Hemisphere, double Longitude, double Latitude, double Easting, double Northing, int Precision, char *MGRS) |
| int | Set_MGRS_Parameters (double a, double f, char *Ellipsoid_Code) |
| void | Get_MGRS_Parameters (double *a, double *f, char *Ellipsoid_Code) |
| int | Convert_Geodetic_To_MGRS (double Latitude, double Longitude, int Precision, char *MGRS) |
| int | Convert_MGRS_To_Geodetic (char *MGRS, double *Latitude, double *Longitude) |
| int | Convert_UTM_To_MGRS (int Zone, char Hemisphere, double Easting, double Northing, int Precision, char *MGRS) |
| int | Convert_MGRS_To_UTM (char *MGRS, int *Zone, char *Hemisphere, double *Easting, double *Northing) |
| int | Convert_UPS_To_MGRS (char Hemisphere, double Easting, double Northing, int Precision, char *MGRS) |
| int | Convert_MGRS_To_UPS (char *MGRS, char *Hemisphere, double *Easting, double *Northing) |
Variables | |
| double | MGRS_a = 6378137.0 |
| double | MGRS_f = 1 / 298.257223563 |
| char | MGRS_Ellipsoid_Code [3] = {'W','E',0} |
| const char * | CLARKE_1866 = "CC" |
| const char * | CLARKE_1880 = "CD" |
| const char * | BESSEL_1841 = "BR" |
| const char * | BESSEL_1841_NAMIBIA = "BN" |
| static const Latitude_Band | Latitude_Band_Table [20] |
| static const UPS_Constant | UPS_Constant_Table [4] |
| #define MAX_PRECISION 5 /* Maximum precision of easting & northing */ |
| #define MAX_UTM_LAT ( (84 * PI) / 180.0 ) /* 84 degrees in radians */ |
| #define MIN_UTM_LAT ( (-80 * PI) / 180.0 ) /* -80 degrees in radians */ |
| typedef struct Latitude_Band_Value Latitude_Band |
| typedef struct UPS_Constant_Value UPS_Constant |
| int Break_MGRS_String | ( | char * | MGRS, |
| int * | Zone, | ||
| int | Letters[MGRS_LETTERS], | ||
| double * | Easting, | ||
| double * | Northing, | ||
| int * | Precision | ||
| ) |
| int Convert_Geodetic_To_MGRS | ( | double | Latitude, |
| double | Longitude, | ||
| int | Precision, | ||
| char * | MGRS | ||
| ) |
| int Convert_MGRS_To_Geodetic | ( | char * | MGRS, |
| double * | Latitude, | ||
| double * | Longitude | ||
| ) |
| int Convert_MGRS_To_UPS | ( | char * | MGRS, |
| char * | Hemisphere, | ||
| double * | Easting, | ||
| double * | Northing | ||
| ) |
| int Convert_MGRS_To_UTM | ( | char * | MGRS, |
| int * | Zone, | ||
| char * | Hemisphere, | ||
| double * | Easting, | ||
| double * | Northing | ||
| ) |
| int Convert_UPS_To_MGRS | ( | char | Hemisphere, |
| double | Easting, | ||
| double | Northing, | ||
| int | Precision, | ||
| char * | MGRS | ||
| ) |
| int Convert_UTM_To_MGRS | ( | int | Zone, |
| char | Hemisphere, | ||
| double | Easting, | ||
| double | Northing, | ||
| int | Precision, | ||
| char * | MGRS | ||
| ) |
| void Get_Grid_Values | ( | int | zone, |
| int * | ltr2_low_value, | ||
| int * | ltr2_high_value, | ||
| double * | pattern_offset | ||
| ) |
| int Get_Latitude_Band_Min_Northing | ( | int | letter, |
| double * | min_northing, | ||
| double * | northing_offset | ||
| ) |
| int Get_Latitude_Range | ( | int | letter, |
| double * | north, | ||
| double * | south | ||
| ) |
| void Get_MGRS_Parameters | ( | double * | a, |
| double * | f, | ||
| char * | Ellipsoid_Code | ||
| ) |
| int Make_MGRS_String | ( | char * | MGRS, |
| int | Zone, | ||
| int | Letters[MGRS_LETTERS], | ||
| double | Easting, | ||
| double | Northing, | ||
| int | Precision | ||
| ) |
| int Set_MGRS_Parameters | ( | double | a, |
| double | f, | ||
| char * | Ellipsoid_Code | ||
| ) |
| int UTM_To_MGRS | ( | int | Zone, |
| char | Hemisphere, | ||
| double | Longitude, | ||
| double | Latitude, | ||
| double | Easting, | ||
| double | Northing, | ||
| int | Precision, | ||
| char * | MGRS | ||
| ) |
|
static |
|
static |