File: Cart3Convert.usage

package info (click to toggle)
geographiclib 2.6-1
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 7,596 kB
  • sloc: cpp: 27,762; sh: 5,463; makefile: 695; python: 12; ansic: 10
file content (215 lines) | stat: -rw-r--r-- 10,578 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
int usage(int retval, bool brief) {
  if (brief)
    ( retval ? std::cerr : std::cout ) << "Usage:\n"
"    Cart3Convert [ -E | -G | -P | -C | -GX | -PX | -CX ] [ -r ] [ -3 | -D ]\n"
"    [ -R nrand ] [ --seed s ] [ -t a b c | -e b e2 k2 kp2 ] [ -d | -: ] [\n"
"    -w ] [ -p prec ] [ --comment-delimiter commentdelim ] [ --version | -h\n"
"    | --help ] [ --input-file infile | --input-string instring ] [\n"
"    --line-separator linesep ] [ --output-file outfile ]\n"
"\n"
"For full documentation type:\n"
"    Cart3Convert --help\n"
"or visit:\n"
"    https://geographiclib.sourceforge.io/C++/2.6/Cart3Convert.1.html\n";
  else
    ( retval ? std::cerr : std::cout ) << "Man page:\n"
"\n"
"SYNOPSIS\n"
"       Cart3Convert [ -E | -G | -P | -C | -GX | -PX | -CX ] [ -r ] [ -3 | -D ]\n"
"       [ -R nrand ] [ --seed s ] [ -t a b c | -e b e2 k2 kp2 ] [ -d | -: ] [\n"
"       -w ] [ -p prec ] [ --comment-delimiter commentdelim ] [ --version | -h\n"
"       | --help ] [ --input-file infile | --input-string instring ] [\n"
"       --line-separator linesep ] [ --output-file outfile ]\n"
"\n"
"DESCRIPTION\n"
"       Convert coordinates for a triaxial ellipsoid to geocentric coordinates.\n"
"       Geocentric coordinates have the origin at the center of the earth, with\n"
"       the X, Y, and Z axes aligned with the major, median, and minor\n"
"       semi-axes, a, b, and c.  By default, the conversion is to geocentric\n"
"       coordinates.  Specifying -r causes the reverse conversion to be\n"
"       performed.\n"
"\n"
"       Seven latitude/longitude/heading coordinate systems are supported\n"
"\n"
"       1.  Ellipsoidal coordinates, beta, omega, and alpha, signified by -En\n"
"           (the default)\n"
"\n"
"       2.  Geodetic coordinates, phi, lambda, and zeta, signified by -G.\n"
"\n"
"       3.  Parametric coordinates, phi', lambda', and zeta, signified by -P.\n"
"\n"
"       4.  Geocentric coordinates, phi\", lambda\", and zeta, signified by -C.\n"
"\n"
"       5.  Geodetic coordinates, phi*, lambda*, and zeta*, with the north pole\n"
"           lying on the X axis, signified by -GX.\n"
"\n"
"       6.  Parametric coordinates, phi*', lambda*', and zeta*, with the north\n"
"           pole lying on the X axis, signified by -PX.\n"
"\n"
"       7.  Geocentric coordinates, phi*\", lambda*\", and zeta*, with the north\n"
"           pole lying on the X axis, signified by -CX.\n"
"\n"
"       In general, only ellipsoidal coordinates are orthogonal.  However for\n"
"       all coordinates, we define the heading as the direction measured\n"
"       clockwise from a line of constant longitude.  zeta is the same for the\n"
"       geodetic, parametric, and geocentric coordinate systems.\n"
"\n"
"       Points away from the surface of the ellipsoid can be described by the\n"
"       orthogonal height h above from the ellipsoid and the position is given\n"
"       by phi, lambda (giving the closest point on the ellipsoid), and h.\n"
"       Alternatively, the confocal ellipsoid of minor radius c + H point can\n"
"       be found and the position of the point is then given by beta, omega for\n"
"       the confocal ellipsoid and H.\n"
"\n"
"       By default, coordinates are provided on standard input as a set of\n"
"       lines containing (blank separated) latitude and longitude (decimal\n"
"       degrees or degrees, minutes and seconds).  The interpretion of the\n"
"       coordinates is governed by the -E, -G, -P, -C -GX, -PX, and -CX flags.\n"
"       For each set of coordinates, the corresponding Cartesian coordinates X,\n"
"       Y, Z (meters) are printed on standard output.  If -r is provided, the\n"
"       reserve operation is undertaken reading X, Y, Z (which asre assumed to\n"
"       denote a point on the ellipsoid) on standard input and printing the\n"
"       latitude and longitude.\n"
"\n"
"       If the -3 flag is given (this cannot be combined with -D), an arbitrary\n"
"       point in three-dimensional space is specified either with beta omega H\n"
"       or with phi lambda h.\n"
"\n"
"       If the -D flag is given (this cannot be combined with -3), the heading\n"
"       (direction) is included in the computation converting beta omega alpha\n"
"       or phi lambda zeta to X, Y, Z Vx, Vy, Vz where [vx, vy, vz] is a unit\n"
"       vector lying in the surface of the ellipsoid.\n"
"\n"
"       If the -R flag is given, do not read any input; instead output random\n"
"       Cartesian points lying on the surface of the ellipsoid.  If the -r flag\n"
"       is specified the Cartesian points are converted into one of the\n"
"       triaxial coordinate systems.\n"
"\n"
"OPTIONS\n"
"       -E  latitude and longitude is interpreted as ellipsoidal coordinates\n"
"           beta and omega.  This is the default.\n"
"\n"
"       -G or -GX\n"
"           latitude and longitude is interpreted as geodetic coordinates phi\n"
"           and lambda.  The X added to the flags means that the north pole\n"
"           lies on the X axis.\n"
"\n"
"       -P or -PX\n"
"           latitude and longitude is interpreted as parametric coordinates\n"
"           phi' and lambda'.  The X added to the flags means that the north\n"
"           pole lies on the X axis.\n"
"\n"
"       -C or -CX\n"
"           latitude and longitude is interpreted as geocentric coordinates\n"
"           phi\" and lambda\".  The X added to the flags means that the north\n"
"           pole lies on the X axis.\n"
"\n"
"       -r  perform the reverse projection from x, y, z to latitude, longitude.\n"
"           Unless -3 is given, it is assumed that the point lies on the\n"
"           surface of the ellipsoid.\n"
"\n"
"       -3  include the height h or H in the calculation.  This cannot be\n"
"           combined with -D.\n"
"\n"
"       -D  include the direction alpha or zeta in the calculation.  With the\n"
"           -r option, it is assumed that the vector [vx, vy, vz] is tangent to\n"
"           the surface of the ellipsoid.  This cannot be combined with -3.\n"
"\n"
"       -R nrand\n"
"           output nrand random points on the surface of the ellipsoid as\n"
"           Cartesian coordinates.  With -D add also a random Cartesian\n"
"           direction tangent to the surface of the ellipsoid.  In this mode,\n"
"           nothing is read from standard input.  With the -r option the random\n"
"           points are converted into one of the triaxial coordinate systems\n"
"           (and the direction is converted to a heading if -D is given).\n"
"\n"
"       --seed s\n"
"           set the random number seed to s when using -R.  s = 0 (the default)\n"
"           causes a random seed to be used.\n"
"\n"
"       -t a b c\n"
"           specify the ellipsoid via its major semiaxis a, median semiaxis b,\n"
"           and minor semixis c.  By default, we have a = 6378172 m, b =\n"
"           6378102 m, c = 6356752 m, an approximate triaxial model of the\n"
"           earth.  (With this model omg = 0deg, corresponds to lon =\n"
"           -14.93deg.\n"
"\n"
"       -e b e2 k2 kp2\n"
"           specify the ellipsoid via the median semiaxis, b and the sphape\n"
"           parameters e2 = (a^2 - c^2)/b^2, k2 = (b^2 - c^2)/(a^2 - c^2), and\n"
"           kp2 = (a^2 - b^2)/(a^2 - c^2).  Simple fractions are allowed for\n"
"           e2, k2, and kp2.  Internally, the supplied values of k2 and kp2 are\n"
"           normalized so that k2 + kp2 = 1.\n"
"\n"
"       -d  output angles as degrees, minutes, seconds instead of decimal\n"
"           degrees.\n"
"\n"
"       -:  like -d, except use : as a separator instead of the d, ', and \"\n"
"           delimiters.\n"
"\n"
"       -w  toggle the longitude first flag (it starts off); if the flag is on,\n"
"           then on input and output, longitude precedes latitude (except that,\n"
"           on input, this can be overridden by a hemisphere designator, N, S,\n"
"           E, W).\n"
"\n"
"       -p prec\n"
"           set the output precision to prec (default 3).  For distances, prec\n"
"           is the number of digits after the decimal point for ellipsoids\n"
"           which are approximately the same size as the Earth; for other\n"
"           ellipsoids the precision is adjusted to retain the same relative\n"
"           precision.  For latitudes and longitudes (in degrees), the number\n"
"           of digits after the decimal point is prec + 5.  For Cartesian\n"
"           directions, the precision is prec + 7.\n"
"\n"
"       --comment-delimiter commentdelim\n"
"           set the comment delimiter to commentdelim (e.g., \"#\" or \"//\").  If\n"
"           set, the input lines will be scanned for this delimiter and, if\n"
"           found, the delimiter and the rest of the line will be removed prior\n"
"           to processing and subsequently appended to the output line\n"
"           (separated by a space).\n"
"\n"
"       --version\n"
"           print version and exit.\n"
"\n"
"       -h  print usage and exit.\n"
"\n"
"       --help\n"
"           print full documentation and exit.\n"
"\n"
"       --input-file infile\n"
"           read input from the file infile instead of from standard input; a\n"
"           file name of \"-\" stands for standard input.\n"
"\n"
"       --input-string instring\n"
"           read input from the string instring instead of from standard input.\n"
"           All occurrences of the line separator character (default is a\n"
"           semicolon) in instring are converted to newlines before the reading\n"
"           begins.\n"
"\n"
"       --line-separator linesep\n"
"           set the line separator character to linesep.  By default this is a\n"
"           semicolon.\n"
"\n"
"       --output-file outfile\n"
"           write output to the file outfile instead of to standard output; a\n"
"           file name of \"-\" stands for standard output.\n"
"\n"
"EXAMPLES\n"
"          echo 1 2 3 | Cart3Convert -t 3 2 1 -3 -p 0 -r\n"
"          => 58.69140 75.11263 2.5860649\n"
"          echo 58.69140 75.11263 2.5860649 | Cart3Convert -t 3 2 1 -3 -p 0\n"
"          => 1.0000001 2.0000003 2.9999999\n"
"\n"
"ERRORS\n"
"       An illegal line of input will print an error message to standard output\n"
"       beginning with \"ERROR:\" and causes Cart3Convert to return an exit code\n"
"       of 1.  However, an error does not cause Cart3Convert to terminate;\n"
"       following lines will be converted.\n"
"\n"
"AUTHOR\n"
"       Cart3Convert was written by Charles Karney.\n"
"\n"
"HISTORY\n"
;
  return retval;
}