File: IntersectTool.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 (227 lines) | stat: -rw-r--r-- 11,331 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
216
217
218
219
220
221
222
223
224
225
226
227
int usage(int retval, bool brief) {
  if (brief)
    ( retval ? std::cerr : std::cout ) << "Usage:\n"
"    IntersectTool [ -c | -n | -i | -o | [ -R maxdist ] [ -e a f] [ -E ] [\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"
"    IntersectTool --help\n"
"or visit:\n"
"    https://geographiclib.sourceforge.io/C++/2.6/IntersectTool.1.html\n";
  else
    ( retval ? std::cerr : std::cout ) << "Man page:\n"
"\n"
"SYNOPSIS\n"
"       IntersectTool [ -c | -n | -i | -o | [ -R maxdist ] [ -e a f] [ -E ] [\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"
"       IntersectTool finds the intersection of two geodesics X and Y.  The\n"
"       geodesics may either be specified as a location and an azimuth, latX\n"
"       lonX aziX, or as the shortest geodesic segment between two locations,\n"
"       latX1 lonX1 and latX2 lonX2.  The intersection is then specified as the\n"
"       displacements, x and y, along the geodesics X and Y from the starting\n"
"       points to the intersection.  In the case of the intersection of\n"
"       geodesic segments, the starting point is first point specified for X or\n"
"       Y.\n"
"\n"
"       Usually this tool returns the closest intersection defined as the one\n"
"       that minimizes the \"L1\" distance, |x| + |y|.  However, it is possible\n"
"       to specify an \"origin\" x0 and y0 when determining closeness so that the\n"
"       intersection which minimizes |x - x0| + |y - y0| is returned.\n"
"\n"
"       In the case of intersecting segments the origin is taken to be the\n"
"       midpoints of the segments; x0 is half the distance from X1 to X2.  In\n"
"       addition a flag is returned specifying whether the intersection is\n"
"       \"within\" the segments.\n"
"\n"
"       The tool also returns a \"coincidence indicator\" c.  This is typically\n"
"       0.  However if the geodesics lie on top of one another at the point of\n"
"       intersection, then c is set to 1, if they are parallel, and -1, if they\n"
"       are antiparallel.\n"
"\n"
"       IntersectTool operates in one of three modes:\n"
"\n"
"       1.  With the -c option (the default), IntersectTool accepts lines on\n"
"           the standard input containing latX lonX aziX latY lonY aziY,\n"
"           specifying two geodesic lines X and Y, and prints the location of\n"
"           the closest intersection x y c on standard output.\n"
"\n"
"       2.  With the -n option, IntersectTool accepts lines on the standard\n"
"           input containing latX lonX aziX aziY aziY, specifying a point where\n"
"           two geodesic lines X and Y intersect, and prints the location of\n"
"           the next closest intersection x y c on standard output.\n"
"\n"
"       3.  With the -i option, IntersectTool accepts lines on the standard\n"
"           input containing latX1 lonX1 latX2 lonX2 latY1 lonY1 latY2 lonY2,\n"
"           specifying two geodesic segments X1-X2 and Y1-Y2, and prints x y c\n"
"           k on standard output.  Here k is a flag in [-4,4] specifying\n"
"           whether the intersection is within the segments (0) or not\n"
"           (non-zero).  x and y give the distances from X1 and Y1\n"
"           respectively.  k is set to 3 kx + ky where kx = -1 if x < 0, 0 if 0\n"
"           <= x <= sx, 1 if sx < x, and similarly for ky; sx is the length of\n"
"           the segment X1-X2.\n"
"\n"
"       4.  With the -o option, IntersectTool accepts lines on the standard\n"
"           input containing latX lonX aziX latY lonY aziY x0 y0, specifying\n"
"           two geodesic lines X and Y and two offsets, and prints x y c on\n"
"           standard output where [x, y] is the intersection closest to [x0,\n"
"           y0].\n"
"\n"
"OPTIONS\n"
"       -c  find the closest intersection (see 1 above).\n"
"\n"
"       -n  find the intersection closest to a given intersection (see 2\n"
"           above).\n"
"\n"
"       -i  find the intersection of two geodesic segments (see 3 above).\n"
"\n"
"       -o  find the closest intersection with an offset.\n"
"\n"
"       -R maxdist\n"
"           modifies the four modes to return all the intersections within an\n"
"           L1 distance, maxdist, of the relevant origin: [0, 0] for -c and -n,\n"
"           the midpoints of the segments for -i, and [x0, y0] for -o.  For\n"
"           each intersection, x y c z is printed on standard output.  Here z\n"
"           is the L1 distance of the intersection from the origin and the\n"
"           intersections are sorted by the distances.  A line \"nan nan 0 nan\"\n"
"           is added after the intersections, so that the output can be\n"
"           associated with the correct lines of the input.  The number of\n"
"           intersections scales as (maxdist/(pi a))^2.\n"
"\n"
"       -C  check the intersections.  For each computed intersection, print on\n"
"           standard error a line latX lonX latY lonY sXY giving the computed\n"
"           positions of the intersections points on X and Y and the distance\n"
"           between them.  If -w is specified, the longitude is given before\n"
"           the latitude.\n"
"\n"
"       -e a f\n"
"           specify the ellipsoid via the equatorial radius, a and the\n"
"           flattening, f.  Setting f = 0 results in a sphere.  Specify f < 0\n"
"           for a prolate ellipsoid.  A simple fraction, e.g., 1/297, is\n"
"           allowed for f.  By default, the WGS84 ellipsoid is used, a =\n"
"           6378137 m, f = 1/298.257223563.\n"
"\n"
"       -E  use \"exact\" algorithms (based on elliptic integrals) for the\n"
"           geodesic calculations.  These are more accurate than the (default)\n"
"           series expansions for |f| > 0.02.\n"
"\n"
"       -w  on input, longitude precedes latitude (except that on input this\n"
"           can be overridden by a hemisphere designator, N, S, E, W).\n"
"\n"
"       -p prec\n"
"           set the output precision to prec (default 3); prec is the precision\n"
"           relative to 1 m.  See \"PRECISION\".\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"
"INPUT\n"
"       IntersectTool measures all angles in degrees and all lengths in meters.\n"
"       On input angles (latitude, longitude, azimuth) can be as decimal\n"
"       degrees or degrees, minutes, seconds.  For example, \"40d30\", \"40d30'\",\n"
"       \"40:30\", \"40.5d\", and 40.5 are all equivalent.  By default, latitude\n"
"       precedes longitude for each point (the -w flag switches this\n"
"       convention); however either may be given first by appending (or\n"
"       prepending) N or S to the latitude and E or W to the longitude.\n"
"       Azimuths are measured clockwise from north; however this may be\n"
"       overridden with E or W.\n"
"\n"
"       For details on the allowed formats for angles, see the \"GEOGRAPHIC\n"
"       COORDINATES\" section of GeoConvert(1).\n"
"\n"
"PRECISION\n"
"       prec gives precision of the output with prec = 0 giving 1 m precision,\n"
"       prec = 3 giving 1 mm precision, etc.  prec is the number of digits\n"
"       after the decimal point for lengths.  The latitude and longitude\n"
"       printed to standard error with the -C option are given in decimal\n"
"       degrees with prec + 5 digits after the decimal point.  The minimum\n"
"       value of prec is 0 and the maximum is 10.\n"
"\n"
"ERRORS\n"
"       An illegal line of input will print an error message to standard output\n"
"       beginning with \"ERROR:\" and causes IntersectTool to return an exit code\n"
"       of 1.  However, an error does not cause IntersectTool to terminate;\n"
"       following lines will be converted.\n"
"\n"
"ACCURACY\n"
"       This tool will give nearly full double precision accuracy for |f| <\n"
"       0.02.  If the -E option is given, full accuracy is achieved for -1/4 <\n"
"       f < 1/5.  The tool had not been tested outside this range.\n"
"\n"
"EXAMPLES\n"
"       A vessel leaves Plymouth 50N 4W on a geodesic path with initial heading\n"
"       147.7W.  When will it first cross the equator?\n"
"\n"
"          echo 50N 4W 147.7W 0 0 90 | IntersectTool -c -p 0 -C\n"
"\n"
"          6058049 -3311253 0\n"
"          0.00000 -29.74549 -0.00000 -29.74549 0\n"
"\n"
"       Answer: after 6058km at longitude 29.7W.  When will it cross the date\n"
"       line, longitude 180E?  Here we need to use -R because there a closer\n"
"       intersection on the prime meridian:\n"
"\n"
"          echo 50N 4W 147.7W 0 180 0 | IntersectTool -c -p 0 -C -R 2.6e7\n"
"\n"
"          -494582 14052230 0 14546812\n"
"          53.69260 0.00000 53.69260 0.00000 0\n"
"          19529110 -5932344 0 25461454\n"
"          -53.51867 180.00000 -53.51867 180.00000 0\n"
"          nan nan 0 nan\n"
"          nan nan nan nan nan\n"
"\n"
"       We want the second result: after 19529 km at latitude 53.5S.\n"
"\n"
"SEE ALSO\n"
"       GeoConvert(1), GeodSolve(1).\n"
"\n"
"       This solution for intersections is described in C. F. F. Karney,\n"
"       Geodesic intersections, J. Surveying Eng. 150(3), 04024005:1-9 (2024),\n"
"       DOI: <https://doi.org/10.1061/JSUED2.SUENG-1483>; preprint\n"
"       <https://arxiv.org/abs/2308.00495>.  It is based on the work of S.\n"
"       Baseldga and J. C. Martinez-Llario, Intersection and point-to-line\n"
"       solutions for geodesics on the ellipsoid, Stud. Geophys. Geod. 62,\n"
"       353-363 (2018); DOI: <https://doi.org/10.1007/s11200-017-1020-z>;\n"
"\n"
"AUTHOR\n"
"       IntersectTool was written by Charles Karney.\n"
"\n"
"HISTORY\n"
;
  return retval;
}