File: Planimeter.usage

package info (click to toggle)
geographiclib 1.37-3
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 9,688 kB
  • ctags: 4,871
  • sloc: cpp: 31,440; sh: 11,632; cs: 9,411; ansic: 1,428; java: 1,333; python: 1,131; makefile: 758; xml: 381; pascal: 30
file content (178 lines) | stat: -rw-r--r-- 8,659 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
int usage(int retval, bool brief) {
  if (brief)
    ( retval ? std::cerr : std::cout ) << "Usage:\n"
"    Planimeter [ -r ] [ -s ] [ -l ] [ -e a f ] [ -p prec ] [ -E ] [ -Q ] [\n"
"    --comment-delimiter commentdelim ] [ --version | -h | --help ] [\n"
"    --input-file infile | --input-string instring ] [ --line-separator\n"
"    linesep ] [ --output-file outfile ]\n"
"\n"
"For full documentation type:\n"
"    Planimeter --help\n"
"or visit:\n"
"    http://geographiclib.sf.net/1.37/Planimeter.1.html\n";
  else
    ( retval ? std::cerr : std::cout ) << "Man page:\n"
"NAME\n"
"       Planimeter -- compute the area of geodesic polygons\n"
"\n"
"SYNOPSIS\n"
"       Planimeter [ -r ] [ -s ] [ -l ] [ -e a f ] [ -p prec ] [ -E ] [ -Q ] [\n"
"       --comment-delimiter commentdelim ] [ --version | -h | --help ] [\n"
"       --input-file infile | --input-string instring ] [ --line-separator\n"
"       linesep ] [ --output-file outfile ]\n"
"\n"
"DESCRIPTION\n"
"       Measure the area of a geodesic polygon.  Reads polygon vertices from\n"
"       standard input, one per line.  Vertices may be given as latitude and\n"
"       longitude, UTM/UPS, or MGRS coordinates, interpreted in the same way as\n"
"       GeoConvert(1).  (MGRS coordinates signify the center of the\n"
"       corresponding MGRS square.)  The end of input, a blank line, or a line\n"
"       which can't be interpreted as a vertex signals the end of one polygon\n"
"       and the start of the next.  For each polygon print a summary line with\n"
"       the number of points, the perimeter (in meters), and the area (in\n"
"       meters^2).\n"
"\n"
"       The edges of the polygon are given by the shortest geodesic between\n"
"       consecutive vertices.  In certain cases, there may be two or many such\n"
"       shortest geodesics, and in that case, the polygon is not uniquely\n"
"       specified by its vertices.  This only happens with very long edges (for\n"
"       the WGS84 ellipsoid, any edge shorter than 19970 km is uniquely\n"
"       specified by its end points).  In such cases, insert an additional\n"
"       vertex near the middle of the long edge to define the boundary of the\n"
"       polygon.\n"
"\n"
"       By default, polygons traversed in a counter-clockwise direction return\n"
"       a positive area and those traversed in a clockwise direction return a\n"
"       negative area.  This sign convention is reversed if the -r option is\n"
"       given.\n"
"\n"
"       Of course, encircling an area in the clockwise direction is equivalent\n"
"       to encircling the rest of the ellipsoid in the counter-clockwise\n"
"       direction.  The default interpretation used by Planimeter is the one\n"
"       that results in a smaller magnitude of area; i.e., the magnitude of the\n"
"       area is less than or equal to one half the total area of the ellipsoid.\n"
"       If the -s option is given, then the interpretation used is the one that\n"
"       results in a positive area; i.e., the area is positive and less than\n"
"       the total area of the ellipsoid.\n"
"\n"
"       Only simple polygons are supported for the area computation.  Polygons\n"
"       may include one or both poles.  There is no need to close the polygon.\n"
"\n"
"OPTIONS\n"
"       -r  toggle whether counter-clockwise traversal of the polygon returns a\n"
"           positive (the default) or negative result.\n"
"\n"
"       -s  toggle whether to return a signed result (the default) or not.\n"
"\n"
"       -l  toggle whether the vertices represent a polygon (the default) or a\n"
"           polyline.  For a polyline, the number of points and the length of\n"
"           the path joining them is returned; the path is not closed and the\n"
"           area is not reported.\n"
"\n"
"       -e  specify the ellipsoid via a f; the equatorial radius is a and the\n"
"           flattening is 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.  (Also, if f > 1, the flattening is set to 1/f.)  By\n"
"           default, the WGS84 ellipsoid is used, a = 6378137 m, f =\n"
"           1/298.257223563.  If entering vertices as UTM/UPS or MGRS\n"
"           coordinates, use the default ellipsoid, since the conversion of\n"
"           these coordinates to latitude and longitude always uses the WGS84\n"
"           parameters.\n"
"\n"
"       -p  set the output precision to prec (default 6); the perimeter is\n"
"           given (in meters) with prec digits after the decimal point; the\n"
"           area is given (in meters^2) with (prec - 5) digits after the\n"
"           decimal point.\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.  (But note that the\n"
"           implementation of areas in GeodesicExact uses a high order series\n"
"           and this is only accurate for modest flattenings.)  -E and -Q are\n"
"           mutually exclusive.\n"
"\n"
"       -Q  perform the calculation on the authalic sphere.  The area\n"
"           calculation is accurate even if the flattening is large, provided\n"
"           the edges are sufficiently short.  The perimeter calculation is not\n"
"           accurate.  -E and -Q are mutually exclusive.\n"
"\n"
"       --comment-delimiter\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.  For a given polygon, the last such string found\n"
"           will be appended to the output line (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\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\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\n"
"           set the line separator character to linesep.  By default this is a\n"
"           semicolon.\n"
"\n"
"       --output-file\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"
"       Example (the area of the 100km MGRS square 18SWK)\n"
"\n"
"          Planimeter <<EOF\n"
"          18n 500000 4400000\n"
"          18n 600000 4400000\n"
"          18n 600000 4500000\n"
"          18n 500000 4500000\n"
"          EOF\n"
"          => 4 400139.53295860 10007388597.1913\n"
"\n"
"       The following code takes the output from gdalinfo and reports the area\n"
"       covered by the data (assuming the edges of the image are geodesics).\n"
"\n"
"          #! /bin/sh\n"
"          egrep '^((Upper|Lower) (Left|Right)|Center) ' |\n"
"          sed -e 's/d /d/g' -e \"s/' /'/g\" | tr -s '(),\\r\\t' ' ' | awk '{\n"
"              if ($1 $2 == \"UpperLeft\")\n"
"                  ul = $6 \" \" $5;\n"
"              else if ($1 $2 == \"LowerLeft\")\n"
"                  ll = $6 \" \" $5;\n"
"              else if ($1 $2 == \"UpperRight\")\n"
"                  ur = $6 \" \" $5;\n"
"              else if ($1 $2 == \"LowerRight\")\n"
"                  lr = $6 \" \" $5;\n"
"              else if ($1 == \"Center\") {\n"
"                  printf \"%s\\n%s\\n%s\\n%s\\n\\n\", ul, ll, lr, ur;\n"
"                  ul = ll = ur = lr = \"\";\n"
"              }\n"
"          }\n"
"          ' | Planimeter | cut -f3 -d' '\n"
"\n"
"SEE ALSO\n"
"       GeoConvert(1).  The algorithm for the area of geodesic polygon is given\n"
"       in Section 6 of C. F. F. Karney, Algorithms for geodesics, J. Geodesy\n"
"       87, 43-55 (2013); DOI <http://dx.doi.org/10.1007/s00190-012-0578-z>;\n"
"       addenda: <http://geographiclib.sf.net/geod-addenda.html>.\n"
"\n"
"AUTHOR\n"
"       Planimeter was written by Charles Karney.\n"
"\n"
"HISTORY\n"
"       Planimeter was added to GeographicLib, <http://geographiclib.sf.net>,\n"
"       in version 1.4.\n"
;
  return retval;
}