[2759] | 1 | /***************************************************************************** |
---|
| 2 | * Todd Hutchinson |
---|
| 3 | * WSI Corporation |
---|
| 4 | * Billerica, MA |
---|
| 5 | *****************************************************************************/ |
---|
| 6 | |
---|
| 7 | /* This header contains the public interface to the GridNav API. */ |
---|
| 8 | |
---|
| 9 | typedef struct { |
---|
| 10 | float central_lat; |
---|
| 11 | float central_lon; |
---|
| 12 | int map_proj; |
---|
| 13 | float truelat1; |
---|
| 14 | float truelat2; |
---|
| 15 | } Projection; |
---|
| 16 | |
---|
| 17 | typedef struct { |
---|
| 18 | int num_columns; |
---|
| 19 | int num_rows; |
---|
| 20 | float dx; |
---|
| 21 | float dy; |
---|
| 22 | float lat_origin; |
---|
| 23 | float lon_origin; |
---|
| 24 | float origin_column; |
---|
| 25 | float origin_row; |
---|
| 26 | } GridStruct; |
---|
| 27 | |
---|
| 28 | typedef struct { |
---|
| 29 | double parm1; |
---|
| 30 | double parm2; |
---|
| 31 | double parm3; |
---|
| 32 | double parm4; |
---|
| 33 | double parm5; |
---|
| 34 | double parm6; |
---|
| 35 | double parm7; |
---|
| 36 | } ProjTransform; |
---|
| 37 | |
---|
| 38 | typedef struct { |
---|
| 39 | Projection proj; |
---|
| 40 | GridStruct grid; |
---|
| 41 | ProjTransform proj_transform; |
---|
| 42 | } GridNav; |
---|
| 43 | |
---|
| 44 | |
---|
| 45 | /* Public Interface */ |
---|
| 46 | |
---|
| 47 | int GRID_init(float center_lat, float center_lon, int projection, |
---|
| 48 | float truelat1, float truelat2, int num_columns, |
---|
| 49 | int num_rows, float dx, float dy, float lat_origin, |
---|
| 50 | float lon_origin, float origin_column, float origin_row, |
---|
| 51 | GridNav *gridnav); |
---|
| 52 | int GRID_to_latlon(GridNav *gridnav, float column, float row, float *lat, |
---|
| 53 | float *lon); |
---|
| 54 | int GRID_from_latlon(GridNav *gridnav, float lat, float lon, float *column, |
---|
| 55 | float *row); |
---|
| 56 | int GRID_rotate_from_earth_coords(GridNav *gridnav, float lon, float u_earth, |
---|
| 57 | float v_earth, float *u_grid, float *v_grid); |
---|
| 58 | int GRID_rotate_to_earth_coords(GridNav *gridnav, float lon, float u_grid, |
---|
| 59 | float v_grid, float *u_earth, float *v_earth); |
---|
| 60 | |
---|
| 61 | #define GRID_LATLON 0 |
---|
| 62 | #define GRID_MERCATOR 1 |
---|
| 63 | #define GRID_LAMCON 3 |
---|
| 64 | #define GRID_POLSTR 5 |
---|