~ubuntu-branches/ubuntu/raring/geotranz/raring

« back to all changes in this revision

Viewing changes to dt_cc/georef/georef.h

  • Committer: Bazaar Package Importer
  • Author(s): Roberto Lumbreras
  • Date: 2008-10-17 14:43:09 UTC
  • Revision ID: james.westby@ubuntu.com-20081017144309-jb7uzfi1y1lvez8j
Tags: upstream-2.4.2
ImportĀ upstreamĀ versionĀ 2.4.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef GEOREF_H
 
2
#define GEOREF_H
 
3
 
 
4
/***************************************************************************/
 
5
/* RSC IDENTIFIER: GEOREF
 
6
 *
 
7
 * ABSTRACT
 
8
 *
 
9
 *    This component provides conversions from Geodetic coordinates (latitude
 
10
 *    and longitude in radians) to a GEOREF coordinate string.
 
11
 *
 
12
 * ERROR HANDLING
 
13
 *
 
14
 *    This component checks parameters for valid values.  If an invalid value
 
15
 *    is found, the error code is combined with the current error code using 
 
16
 *    the bitwise or.  This combining allows multiple error codes to be
 
17
 *    returned. The possible error codes are:
 
18
 *
 
19
 *          GEOREF_NO_ERROR          : No errors occurred in function
 
20
 *          GEOREF_LAT_ERROR         : Latitude outside of valid range 
 
21
 *                                      (-90 to 90 degrees)
 
22
 *          GEOREF_LON_ERROR         : Longitude outside of valid range
 
23
 *                                      (-180 to 360 degrees)
 
24
 *          GEOREF_STR_ERROR         : A GEOREF string error: string too long,
 
25
 *                                       string too short, or string length
 
26
 *                                       not even.
 
27
 *          GEOREF_STR_LAT_ERROR     : The latitude part of the GEOREF string
 
28
 *                                     (second or fourth character) is invalid.
 
29
 *          GEOREF_STR_LON_ERROR     : The longitude part of the GEOREF string
 
30
 *                                     (first or third character) is invalid.
 
31
 *          GEOREF_STR_LAT_MIN_ERROR : The latitude minute part of the GEOREF
 
32
 *                                      string is greater than 60.
 
33
 *          GEOREF_STR_LON_MIN_ERROR : The longitude minute part of the GEOREF
 
34
 *                                      string is greater than 60.
 
35
 *          GEOREF_PRECISION_ERROR   : The precision must be between 0 and 5 
 
36
 *                                      inclusive.
 
37
 *
 
38
 * REUSE NOTES
 
39
 *
 
40
 *    GEOREF is intended for reuse by any application that performs a 
 
41
 *    conversion between Geodetic and GEOREF coordinates.
 
42
 *    
 
43
 * REFERENCES
 
44
 *
 
45
 *    Further information on GEOREF can be found in the Reuse Manual.
 
46
 *
 
47
 *    GEOREF originated from :  U.S. Army Topographic Engineering Center
 
48
 *                              Geospatial Information Division
 
49
 *                              7701 Telegraph Road
 
50
 *                              Alexandria, VA  22310-3864
 
51
 *
 
52
 * LICENSES
 
53
 *
 
54
 *    None apply to this component.
 
55
 *
 
56
 * RESTRICTIONS
 
57
 *
 
58
 *    GEOREF has no restrictions.
 
59
 *
 
60
 * ENVIRONMENT
 
61
 *
 
62
 *    GEOREF was tested and certified in the following environments:
 
63
 *
 
64
 *    1. Solaris 2.5 with GCC version 2.8.1
 
65
 *    2. Windows 95 with MS Visual C++ version 6
 
66
 *
 
67
 * MODIFICATIONS
 
68
 *
 
69
 *    Date              Description
 
70
 *    ----              -----------
 
71
 *    20-02-97          Original Code
 
72
 */
 
73
 
 
74
 
 
75
/***************************************************************************/
 
76
/*
 
77
 *                               DEFINES
 
78
 */
 
79
#define GEOREF_NO_ERROR             0x0000
 
80
#define GEOREF_LAT_ERROR            0x0001
 
81
#define GEOREF_LON_ERROR            0x0002
 
82
#define GEOREF_STR_ERROR            0x0004
 
83
#define GEOREF_STR_LAT_ERROR        0x0008
 
84
#define GEOREF_STR_LON_ERROR        0x0010
 
85
#define GEOREF_STR_LAT_MIN_ERROR    0x0020
 
86
#define GEOREF_STR_LON_MIN_ERROR    0x0040
 
87
#define GEOREF_PRECISION_ERROR      0x0080
 
88
 
 
89
 
 
90
/***************************************************************************/
 
91
/*
 
92
 *                             FUNCTION PROTOTYPES
 
93
 *                                for georef.c
 
94
 */
 
95
 
 
96
/* ensure proper linkage to c++ programs */
 
97
#ifdef __cplusplus
 
98
extern "C" {
 
99
#endif
 
100
 
 
101
 
 
102
  long Convert_Geodetic_To_GEOREF (double Latitude,
 
103
                                   double Longitude,
 
104
                                   long Precision,
 
105
                                   char *Georef);
 
106
/*   
 
107
 *  This function converts Geodetic (latitude and longitude in radians)
 
108
 *  coordinates to a GEOREF coordinate string.  Precision specifies the
 
109
 *  number of digits in the GEOREF string for latitude and longitude:
 
110
 *                                  0 for nearest degree
 
111
 *                                  1 for nearest 10 minutes
 
112
 *                                  2 for nearest minute
 
113
 *                                  3 for nearest tenth of a minute
 
114
 *                                  4 for nearest hundredth of a minute
 
115
 *                                  5 for nearest thousandth of a minute
 
116
 *
 
117
 *    Latitude  : Latitude in radians                       (input)
 
118
 *    Longitude : Longitude in radians                      (input)
 
119
 *    Precision : level of precision specified by the user  (input)
 
120
 *    Georef    : GEOREF coordinate string                  (output)
 
121
 */
 
122
 
 
123
 
 
124
  long Convert_GEOREF_To_Geodetic (char *Georef,
 
125
                                   double *Latitude, 
 
126
                                   double *Longitude);
 
127
/*
 
128
 *  This function converts a GEOREF coordinate string to Geodetic (latitude
 
129
 *  and longitude in radians) coordinates.
 
130
 *
 
131
 *    Georef    : GEOREF coordinate string     (input)
 
132
 *    Latitude  : Latitude in radians          (output)
 
133
 *    Longitude : Longitude in radians         (output)
 
134
*/
 
135
 
 
136
 
 
137
#ifdef __cplusplus
 
138
}
 
139
#endif
 
140
 
 
141
#endif /* GEOREF_H */