GeoConvert.1 20.7 KB
Newer Older
Valentin Platzgummer's avatar
Valentin Platzgummer committed
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 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532
.\" Automatically generated by Pod::Man 4.12 (Pod::Simple 3.39)
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" Set up some character translations and predefined strings.  \*(-- will
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
.\" double quote, and \*(R" will give a right double quote.  \*(C+ will
.\" give a nicer C++.  Capital omega is used to do unbreakable dashes and
.\" therefore won't be available.  \*(C` and \*(C' expand to `' in nroff,
.\" nothing in troff, for use with C<>.
.tr \(*W-
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
.ie n \{\
.    ds -- \(*W-
.    ds PI pi
.    if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
.    if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\"  diablo 12 pitch
.    ds L" ""
.    ds R" ""
.    ds C` ""
.    ds C' ""
'br\}
.el\{\
.    ds -- \|\(em\|
.    ds PI \(*p
.    ds L" ``
.    ds R" ''
.    ds C`
.    ds C'
'br\}
.\"
.\" Escape single quotes in literal strings from groff's Unicode transform.
.ie \n(.g .ds Aq \(aq
.el       .ds Aq '
.\"
.\" If the F register is >0, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
.\" entries marked with X<> in POD.  Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.\"
.\" Avoid warning from groff about undefined register 'F'.
.de IX
..
.nr rF 0
.if \n(.g .if rF .nr rF 1
.if (\n(rF:(\n(.g==0)) \{\
.    if \nF \{\
.        de IX
.        tm Index:\\$1\t\\n%\t"\\$2"
..
.        if !\nF==2 \{\
.            nr % 0
.            nr F 2
.        \}
.    \}
.\}
.rr rF
.\"
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
.\" Fear.  Run.  Save yourself.  No user-serviceable parts.
.    \" fudge factors for nroff and troff
.if n \{\
.    ds #H 0
.    ds #V .8m
.    ds #F .3m
.    ds #[ \f1
.    ds #] \fP
.\}
.if t \{\
.    ds #H ((1u-(\\\\n(.fu%2u))*.13m)
.    ds #V .6m
.    ds #F 0
.    ds #[ \&
.    ds #] \&
.\}
.    \" simple accents for nroff and troff
.if n \{\
.    ds ' \&
.    ds ` \&
.    ds ^ \&
.    ds , \&
.    ds ~ ~
.    ds /
.\}
.if t \{\
.    ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
.    ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
.    ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
.    ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
.    ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
.    ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
.\}
.    \" troff and (daisy-wheel) nroff accents
.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
.ds ae a\h'-(\w'a'u*4/10)'e
.ds Ae A\h'-(\w'A'u*4/10)'E
.    \" corrections for vroff
.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
.    \" for low resolution devices (crt and lpr)
.if \n(.H>23 .if \n(.V>19 \
\{\
.    ds : e
.    ds 8 ss
.    ds o a
.    ds d- d\h'-1'\(ga
.    ds D- D\h'-1'\(hy
.    ds th \o'bp'
.    ds Th \o'LP'
.    ds ae ae
.    ds Ae AE
.\}
.rm #[ #] #H #V #F C
.\" ========================================================================
.\"
.IX Title "GEOCONVERT 1"
.TH GEOCONVERT 1 "2019-12-12" "GeographicLib 1.50.1" "GeographicLib Utilities"
.\" For nroff, turn off justification.  Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
.nh
.SH "NAME"
GeoConvert \-\- convert geographic coordinates
.SH "SYNOPSIS"
.IX Header "SYNOPSIS"
\&\fBGeoConvert\fR [ \fB\-g\fR | \fB\-d\fR | \fB\-:\fR | \fB\-u\fR | \fB\-m\fR | \fB\-c\fR ]
[ \fB\-z\fR \fIzone\fR | \fB\-s\fR | \fB\-t\fR | \fB\-S\fR | \fB\-T\fR ]
[ \fB\-n\fR ] [ \fB\-w\fR ] [ \fB\-p\fR \fIprec\fR ] [ \fB\-l\fR | \fB\-a\fR ]
[ \fB\-\-comment\-delimiter\fR \fIcommentdelim\fR ]
[ \fB\-\-version\fR | \fB\-h\fR | \fB\-\-help\fR ]
[ \fB\-\-input\-file\fR \fIinfile\fR | \fB\-\-input\-string\fR \fIinstring\fR ]
[ \fB\-\-line\-separator\fR \fIlinesep\fR ]
[ \fB\-\-output\-file\fR \fIoutfile\fR ]
.SH "DESCRIPTION"
.IX Header "DESCRIPTION"
\&\fBGeoConvert\fR reads from standard input interpreting each line as a
geographic coordinate and prints the coordinate in the format specified
by the options on standard output.  The input is interpreted in one of
three different ways depending on how many space or comma delimited
tokens there are on the line.  The options \fB\-g\fR, \fB\-d\fR, \fB\-u\fR, and \fB\-m\fR
govern the format of output.  In all cases, the \s-1WGS84\s0 model of the earth
is used (\fIa\fR = 6378137 m, \fIf\fR = 1/298.257223563).
.IP "\fBgeographic\fR" 4
.IX Item "geographic"
2 tokens (output options \fB\-g\fR, \fB\-d\fR, or \fB\-:\fR) given as \fIlatitude\fR
\&\fIlongitude\fR using decimal degrees or degrees, minutes, and seconds.
Latitude is given first (unless the \fB\-w\fR option is given).  See
\&\*(L"\s-1GEOGRAPHIC COORDINATES\*(R"\s0 for a description of the format.  For
example, the following are all equivalent
.Sp
.Vb 5
\&    33.3 44.4
\&    E44.4 N33.3
\&    33d18\*(AqN 44d24\*(AqE
\&    44d24 33d18N
\&    33:18 +44:24
.Ve
.IP "\fB\s-1UTM/UPS\s0\fR" 4
.IX Item "UTM/UPS"
3 tokens (output option \fB\-u\fR) given as \fIzone\fR+\fIhemisphere\fR \fIeasting\fR
\&\fInorthing\fR or \fIeasting\fR \fInorthing\fR \fIzone\fR+\fIhemisphere\fR, where
\&\fIhemisphere\fR is either \fIn\fR (or \fInorth\fR) or \fIs\fR (or \fIsouth\fR).  The
\&\fIzone\fR is absent for a \s-1UPS\s0 specification.  For example,
.Sp
.Vb 4
\&    38n 444140.54 3684706.36
\&    444140.54 3684706.36 38n
\&    s 2173854.98 2985980.58
\&    2173854.98 2985980.58 s
.Ve
.IP "\fB\s-1MRGS\s0\fR" 4
.IX Item "MRGS"
1 token (output option \fB\-m\fR) is used to specify the center of an \s-1MGRS\s0
grid square.  For example,
.Sp
.Vb 2
\&    38SMB4484
\&    38SMB44140847064
.Ve
.SH "OPTIONS"
.IX Header "OPTIONS"
.IP "\fB\-g\fR" 4
.IX Item "-g"
output latitude and longitude using decimal degrees.  Default output mode.
.IP "\fB\-d\fR" 4
.IX Item "-d"
output latitude and longitude using degrees, minutes, and seconds (\s-1DMS\s0).
.IP "\fB\-:\fR" 4
.IX Item "-:"
like \fB\-d\fR, except use : as a separator instead of the d, ', and "
delimiters.
.IP "\fB\-u\fR" 4
.IX Item "-u"
output \s-1UTM\s0 or \s-1UPS.\s0
.IP "\fB\-m\fR" 4
.IX Item "-m"
output \s-1MGRS.\s0
.IP "\fB\-c\fR" 4
.IX Item "-c"
output meridian convergence and scale for the corresponding \s-1UTM\s0 or \s-1UPS\s0
projection.  The meridian convergence is the bearing of grid north given
as degrees clockwise from true north.
.IP "\fB\-z\fR \fIzone\fR" 4
.IX Item "-z zone"
set the zone to \fIzone\fR for output.  Use either 0 < \fIzone\fR <=
60 for a \s-1UTM\s0 zone or \fIzone\fR = 0 for \s-1UPS.\s0  Alternatively use a
\&\fIzone\fR+\fIhemisphere\fR designation, e.g., 38n.  See \*(L"\s-1ZONE\*(R"\s0.
.IP "\fB\-s\fR" 4
.IX Item "-s"
use the standard \s-1UPS\s0 and \s-1UTM\s0 zones.
.IP "\fB\-t\fR" 4
.IX Item "-t"
similar to \fB\-s\fR but forces \s-1UPS\s0 regions to the closest \s-1UTM\s0 zone.
.IP "\fB\-S\fR or \fB\-T\fR" 4
.IX Item "-S or -T"
behave the same as \fB\-s\fR and \fB\-t\fR, respectively, until the first legal
conversion is performed.  For subsequent points, the zone and hemisphere
of that conversion are used.  This enables a sequence of points to be
converted into \s-1UTM\s0 or \s-1UPS\s0 using a consistent coordinate system.
.IP "\fB\-n\fR" 4
.IX Item "-n"
on input, \s-1MGRS\s0 coordinates refer to the south-west corner of the \s-1MGRS\s0
square instead of the center; see \*(L"\s-1MGRS\*(R"\s0.
.IP "\fB\-w\fR" 4
.IX Item "-w"
toggle the longitude first flag (it starts off); if the flag is on, then
on input and output, longitude precedes latitude (except that, on input,
this can be overridden by a hemisphere designator, \fIN\fR, \fIS\fR, \fIE\fR,
\&\fIW\fR).
.IP "\fB\-p\fR \fIprec\fR" 4
.IX Item "-p prec"
set the output precision to \fIprec\fR (default 0); \fIprec\fR is the
precision relative to 1 m.  See \*(L"\s-1PRECISION\*(R"\s0.
.IP "\fB\-l\fR" 4
.IX Item "-l"
on output, \s-1UTM/UPS\s0 uses the long forms \fInorth\fR and \fIsouth\fR to
designate the hemisphere instead of \fIn\fR or \fIs\fR.
.IP "\fB\-a\fR" 4
.IX Item "-a"
on output, \s-1UTM/UPS\s0 uses the abbreviations \fIn\fR and \fIs\fR to designate the
hemisphere instead of \fInorth\fR or \fIsouth\fR; this is the default
representation.
.IP "\fB\-\-comment\-delimiter\fR \fIcommentdelim\fR" 4
.IX Item "--comment-delimiter commentdelim"
set the comment delimiter to \fIcommentdelim\fR (e.g., \*(L"#\*(R" or \*(L"//\*(R").  If
set, the input lines will be scanned for this delimiter and, if found,
the delimiter and the rest of the line will be removed prior to
processing and subsequently appended to the output line (separated by a
space).
.IP "\fB\-\-version\fR" 4
.IX Item "--version"
print version and exit.
.IP "\fB\-h\fR" 4
.IX Item "-h"
print usage and exit.
.IP "\fB\-\-help\fR" 4
.IX Item "--help"
print full documentation and exit.
.IP "\fB\-\-input\-file\fR \fIinfile\fR" 4
.IX Item "--input-file infile"
read input from the file \fIinfile\fR instead of from standard input; a file
name of \*(L"\-\*(R" stands for standard input.
.IP "\fB\-\-input\-string\fR \fIinstring\fR" 4
.IX Item "--input-string instring"
read input from the string \fIinstring\fR instead of from standard input.
All occurrences of the line separator character (default is a semicolon)
in \fIinstring\fR are converted to newlines before the reading begins.
.IP "\fB\-\-line\-separator\fR \fIlinesep\fR" 4
.IX Item "--line-separator linesep"
set the line separator character to \fIlinesep\fR.  By default this is a
semicolon.
.IP "\fB\-\-output\-file\fR \fIoutfile\fR" 4
.IX Item "--output-file outfile"
write output to the file \fIoutfile\fR instead of to standard output; a
file name of \*(L"\-\*(R" stands for standard output.
.SH "PRECISION"
.IX Header "PRECISION"
\&\fIprec\fR gives precision of the output with \fIprec\fR = 0 giving 1 m
precision, \fIprec\fR = 3 giving 1 mm precision, etc.  \fIprec\fR is the
number of digits after the decimal point for \s-1UTM/UPS.\s0  For \s-1MGRS,\s0 The
number of digits per coordinate is 5 + \fIprec\fR; \fIprec\fR = \-6 results in
just the grid zone.  For decimal degrees, the number of digits after the
decimal point is 5 + \fIprec\fR.  For \s-1DMS\s0 (degree, minute, seconds) output,
the number of digits after the decimal point in the seconds components
is 1 + \fIprec\fR; if this is negative then use minutes (\fIprec\fR = \-2 or
\&\-3) or degrees (\fIprec\fR <= \-4) as the least significant component.
Print convergence, resp. scale, with 5 + \fIprec\fR, resp. 7 + \fIprec\fR,
digits after the decimal point.  The minimum value of \fIprec\fR is \-5 (\-6
for \s-1MGRS\s0) and the maximum is 9 for \s-1UTM/UPS, 9\s0 for decimal degrees, 10
for \s-1DMS, 6\s0 for \s-1MGRS,\s0 and 8 for convergence and scale.
.SH "GEOGRAPHIC COORDINATES"
.IX Header "GEOGRAPHIC COORDINATES"
The utility accepts geographic coordinates, latitude and longitude, in a
number of common formats.  Latitude precedes longitude, unless the \fB\-w\fR
option is given which switches this convention.  On input, either
coordinate may be given first by appending or prepending \fIN\fR or \fIS\fR to
the latitude and \fIE\fR or \fIW\fR to the longitude.  These hemisphere
designators carry an implied sign, positive for \fIN\fR and \fIE\fR and
negative for \fIS\fR and \fIW\fR.  This sign multiplies any +/\- sign prefixing
the coordinate.  The coordinates may be given as decimal degree or as
degrees, minutes, and seconds.  d, ', and " are used to denote degrees,
minutes, and seconds, with the least significant designator optional.
(See \*(L"\s-1QUOTING\*(R"\s0 for how to quote the characters ' and " when entering
coordinates on the command line.)  Alternatively, : (colon) may be used
to separate the various components.  Only the final component of
coordinate can include a decimal point, and the minutes and seconds
components must be less than 60.
.PP
It is also possible to carry out addition or subtraction operations in
geographic coordinates.  If the coordinate includes interior signs
(i.e., not at the beginning or immediately after an initial hemisphere
designator), then the coordinate is split before such signs; the pieces
are parsed separately and the results summed.  For example the point 15"
east of 39N 70W is
.PP
.Vb 1
\&    39N 70W+0:0:15E
.Ve
.PP
\&\fB\s-1WARNING:\s0\fR \*(L"Exponential\*(R" notation is not recognized for geographic
coordinates.  Thus 7.0E1 is illegal, while 7.0E+1 is parsed
as (7.0E) + (+1), yielding the same result as 8.0E.
.PP
Various unicode characters (encoded with \s-1UTF\-8\s0) may also be used to
denote degrees, minutes, and seconds, e.g., the degree, prime, and
double prime symbols; in addition two single quotes can be used to
represent ".
.PP
The other GeographicLib utilities use the same rules for interpreting
geographic coordinates; in addition, azimuths and arc lengths are
interpreted the same way.
.SH "QUOTING"
.IX Header "QUOTING"
Unfortunately the characters ' and \*(L" have special meanings in many
shells and have to be entered with care.  However note (1) that the
trailing designator is optional and that (2) you can use colons as a
separator character.  Thus 10d20' can be entered as 10d20 or 10:20 and
10d20'30\*(R" can be entered as 10:20:30.
.IP "Unix shells (sh, bash, tsch)" 4
.IX Item "Unix shells (sh, bash, tsch)"
The characters ' and \*(L" can be quoted by preceding them with a \e
(backslash); or you can quote a string containing ' with a pair of \*(R"s.
The two alternatives are illustrated by
.Sp
.Vb 2
\&   echo 10d20\e\*(Aq30\e" "20d30\*(Aq40" | GeoConvert \-d \-p \-1
\&   => 10d20\*(Aq30"N 020d30\*(Aq40"E
.Ve
.Sp
Quoting of command line arguments is similar
.Sp
.Vb 2
\&   GeoConvert \-d \-p \-1 \-\-input\-string "10d20\*(Aq30\e" 20d30\*(Aq40"
\&   => 10d20\*(Aq30"N 020d30\*(Aq40"E
.Ve
.IP "Windows command shell (cmd)" 4
.IX Item "Windows command shell (cmd)"
The ' character needs no quoting; the " character can either be quoted
by a ^ or can be represented by typing ' twice.  (This quoting is
usually unnecessary because the trailing designator can be omitted.)
Thus
.Sp
.Vb 2
\&   echo 10d20\*(Aq30\*(Aq\*(Aq 20d30\*(Aq40 | GeoConvert \-d \-p \-1
\&   => 10d20\*(Aq30"N 020d30\*(Aq40"E
.Ve
.Sp
Use \e to quote the " character in a command line argument
.Sp
.Vb 2
\&   GeoConvert \-d \-p \-1 \-\-input\-string "10d20\*(Aq30\e" 20d30\*(Aq40"
\&   => 10d20\*(Aq30"N 020d30\*(Aq40"E
.Ve
.IP "Input from a file" 4
.IX Item "Input from a file"
No quoting need be done if the input from a file.  Thus each line of the
file \f(CW\*(C`input.txt\*(C'\fR should just contain the plain coordinates.
.Sp
.Vb 1
\&  GeoConvert \-d \-p \-1 < input.txt
.Ve
.SH "MGRS"
.IX Header "MGRS"
\&\s-1MGRS\s0 coordinates represent a square patch of the earth, thus
\&\f(CW\*(C`38SMB4488\*(C'\fR is in zone \f(CW\*(C`38n\*(C'\fR with 444km <= \fIeasting\fR <
445km and 3688km <= \fInorthing\fR < 3689km.  Consistent with
this representation, coordinates are \fItruncated\fR (instead of
\&\fIrounded\fR) to the requested precision.  When an \s-1MGRS\s0 coordinate is
provided as input, \fBGeoConvert\fR treats this as a representative point
within the square.  By default, this representative point is the
\&\fIcenter\fR of the square (\f(CW\*(C`38n 444500 3688500\*(C'\fR in the example above).
(This leads to a stable conversion between \s-1MGRS\s0 and geographic
coordinates.)  However, if the \fB\-n\fR option is given then the
south-west corner of the square is returned instead (\f(CW\*(C`38n 444000
3688000\*(C'\fR in the example above).
.SH "ZONE"
.IX Header "ZONE"
If the input is \fBgeographic\fR, \fBGeoConvert\fR uses the standard rules of
selecting \s-1UTM\s0 vs \s-1UPS\s0 and for assigning the \s-1UTM\s0 zone (with the Norway and
Svalbard exceptions).  If the input is \fB\s-1UTM/UPS\s0\fR or \fB\s-1MGRS\s0\fR, then the
choice between \s-1UTM\s0 and \s-1UPS\s0 and the \s-1UTM\s0 zone mirrors the input.  The \fB\-z\fR
\&\fIzone\fR, \fB\-s\fR, and \fB\-t\fR options allow these rules to be overridden
with \fIzone\fR = 0 being used to indicate \s-1UPS.\s0  For example, the point
.PP
.Vb 1
\&   79.9S 6.1E
.Ve
.PP
corresponds to possible \s-1MGRS\s0 coordinates
.PP
.Vb 3
\&   32CMS4324728161 (standard UTM zone = 32)
\&   31CEM6066227959 (neighboring UTM zone = 31)
\&     BBZ1945517770 (neighboring UPS zone)
.Ve
.PP
then
.PP
.Vb 4
\&   echo 79.9S 6.1E      | GeoConvert \-p \-3 \-m       => 32CMS4328
\&   echo 31CEM6066227959 | GeoConvert \-p \-3 \-m       => 31CEM6027
\&   echo 31CEM6066227959 | GeoConvert \-p \-3 \-m \-s    => 32CMS4328
\&   echo 31CEM6066227959 | GeoConvert \-p \-3 \-m \-z 0  =>   BBZ1917
.Ve
.PP
Is \fIzone\fR is specified with a hemisphere, then this is honored when
printing \s-1UTM\s0 coordinates:
.PP
.Vb 4
\&   echo \-1 3 | GeoConvert \-u         => 31s 500000 9889470
\&   echo \-1 3 | GeoConvert \-u \-z 31   => 31s 500000 9889470
\&   echo \-1 3 | GeoConvert \-u \-z 31s  => 31s 500000 9889470
\&   echo \-1 3 | GeoConvert \-u \-z 31n  => 31n 500000 \-110530
.Ve
.PP
\&\fB\s-1NOTE\s0\fR: the letter in the zone specification for \s-1UTM\s0 is a hemisphere
designator \fIn\fR or \fIs\fR and \fInot\fR an \s-1MGRS\s0 latitude band letter.
Convert the \s-1MGRS\s0 latitude band letter to a hemisphere as follows:
replace \fIC\fR thru \fIM\fR by \fIs\fR (or \fIsouth\fR); replace \fIN\fR thru \fIX\fR by
\&\fIn\fR (or \fInorth\fR).
.SH "EXAMPLES"
.IX Header "EXAMPLES"
.Vb 4
\&   echo 38SMB4488 | GeoConvert         => 33.33424 44.40363
\&   echo 38SMB4488 | GeoConvert \-: \-p 1 => 33:20:03.25N 044:2413.06E
\&   echo 38SMB4488 | GeoConvert \-u      => 38n 444500 3688500
\&   echo E44d24 N33d20 | GeoConvert \-m \-p \-3 => 38SMB4488
.Ve
.PP
GeoConvert can be used to do simple arithmetic using degree, minutes,
and seconds.  For example, sometimes data is tiled in 15 second squares
tagged by the \s-1DMS\s0 representation of the \s-1SW\s0 corner.  The tags of the tile
at 38:59:45N 077:02:00W and its 8 neighbors are then given by
.PP
.Vb 10
\&    t=0:0:15
\&    for y in \-$t +0 +$t; do
\&        for x in \-$t +0 +$t; do
\&            echo 38:59:45N$y 077:02:00W$x
\&        done
\&    done | GeoConvert \-: \-p \-1 | tr \-d \*(Aq: \*(Aq
\&    =>
\&    385930N0770215W
\&    385930N0770200W
\&    385930N0770145W
\&    385945N0770215W
\&    385945N0770200W
\&    385945N0770145W
\&    390000N0770215W
\&    390000N0770200W
\&    390000N0770145W
.Ve
.SH "ERRORS"
.IX Header "ERRORS"
An illegal line of input will print an error message to standard output
beginning with \f(CW\*(C`ERROR:\*(C'\fR and causes \fBGeoConvert\fR to return an exit code
of 1.  However, an error does not cause \fBGeoConvert\fR to terminate;
following lines will be converted.
.SH "ABBREVIATIONS"
.IX Header "ABBREVIATIONS"
.IP "\fB\s-1UTM\s0\fR" 4
.IX Item "UTM"
Universal Transverse Mercator,
<https://en.wikipedia.org/wiki/Universal_Transverse_Mercator_coordinate_system>.
.IP "\fB\s-1UPS\s0\fR" 4
.IX Item "UPS"
Universal Polar Stereographic,
<https://en.wikipedia.org/wiki/Universal_Polar_Stereographic>.
.IP "\fB\s-1MGRS\s0\fR" 4
.IX Item "MGRS"
Military Grid Reference System,
<https://en.wikipedia.org/wiki/Military_grid_reference_system>.
.IP "\fB\s-1WGS84\s0\fR" 4
.IX Item "WGS84"
World Geodetic System 1984,
<https://en.wikipedia.org/wiki/WGS84>.
.SH "SEE ALSO"
.IX Header "SEE ALSO"
An online version of this utility is availbable at
<https://geographiclib.sourceforge.io/cgi\-bin/GeoConvert>.
.PP
The algorithms for the transverse Mercator projection are described in
C. F. F. Karney, \fITransverse Mercator with an accuracy of a few
nanometers\fR, J. Geodesy \fB85\fR(8), 475\-485 (Aug. 2011); \s-1DOI\s0
<https://doi.org/10.1007/s00190\-011\-0445\-3>; preprint
<https://arxiv.org/abs/1002.1417>.
.SH "AUTHOR"
.IX Header "AUTHOR"
\&\fBGeoConvert\fR was written by Charles Karney.
.SH "HISTORY"
.IX Header "HISTORY"
\&\fBGeoConvert\fR was added to GeographicLib,
<https://geographiclib.sourceforge.io>, in 2009\-01.