Provided by: geographiclib-tools_1.8-2_amd64

**NAME**

GeoConvert -- convert geographic coordinates

**SYNOPSIS**

GeoConvert[-g|-d|-u|-m|-c] [-pprec] [-zzone|-s|-t] [-n] [--version|-h|--help]

**DESCRIPTION**

GeoConvertreads 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-g,-d,-u, and-mgovern the format of output. In all cases, the WGS84 model of the earth is used (a= 6378137m,f= 1/298.257223563).geographic2 tokens (output options-gor-d) given aslatitudelongitudeusing decimal degrees or degrees minutes seconds. d, ', and " are used to denote degrees, minutes, and seconds, with the least significant designator optional. Latitude is given first; however, on input, either may be given first by appending or prependingNorSto the latitude andEorWto the longitude. For example, the following are all equivalent 33.3 44.4 E44.4 N33.3 33d18'N 44d24'E 44d24 33d18NUTM/UPS3 tokens (output option-u) given aszone+hemisphereeastingnorthingoreastingnorthingzone+hemisphere, wherehemisphereis eitherNorS. Thezoneis absent for a UPS specification. For example, 38N 444140.54 3684706.36 444140.54 3684706.36 38N S 2173854.98 2985980.58 2173854.98 2985980.58 SMRGS1 token (output option-m) is used to specify the center of an MGRS grid square. For example, 38SMB4484 38SMB44140847064

**OPTIONS**

-goutput latitude and longitude using decimal degrees. Default output mode.-doutput latitude and longitude using degrees, minutes, and seconds (DMS).-uoutput UTM or UPS.-moutput MGRS.-coutput meridian convergence and scale for the corresponding UTM or UPS projection. Convergence is the bearing of grid north given as degrees clockwise from true north.-pset the precision toprec(default 0);precis the precision relative to 1m. See PRECISION.-zset the zone tozonefor output. Use either 0 <zone<= 60 for a UTM zone orzone= 0 for UPS. Alternatively use azone+hemispheredesignation (hemisphereis ignored), e.g., 38N. See ZONE.-suse the standard UPS and UTM zones.-tsimilar to-sbut forces UPS regions to the closest UTM zone.-non input, MGRS coordinates refer to the south-west corner of the MGRS square instead of the center; see MGRS.--versionprint version.-hprint usage.--helpprint full documentation.

**PRECISION**

precgives precision of the output withprec= 0 giving 1m precision,prec= 3 giving 1mm precision, etc.precis the number of digits after the decimal point for UTM/UPS. The number of digits per coordinate for MGRS is 5 +prec. For decimal degrees, the number of digits after the decimal point is 5 +prec. For DMS (degree, minute, seconds) output, the number of digits after the decimal point in the seconds components is 1 +prec; if this is negative then use minutes (prec= -2 or -3) or degrees (prec<= -4) as the least significant component. Print convergence, resp. scale, with 5 +prec, resp. 7 +prec, digits after the decimal point. The minimum value ofprecis -5 and the maximum is 9 for UTM/UPS, 9 for decimal degrees, 10 for DMS, 6 for MGRS, and 8 for convergence and scale.

**MGRS**

MGRS coordinates represent a square patch of the earth, thus "38SMB4488" is in zone "38N" with 444km <=easting< 445km and 3688km <=northing< 3689km. Consistent with this representation, coordinates aretruncated(instead ofrounded) to the requested precision. Similiarly, on input an MGRS coordinate represents thecenterof the square ("38N 444500 3688500" in the example above). However, if the-noption is given then the south-west corner of the square is returned instead ("38N 444000 3688000" in the example above).

**ZONE**

If the input isgeographic,GeoConvertuses the standard rules of selecting UTM vs UPS and for assigning the UTM zone (with the Norway and Svalbard exceptions). If the input isUTM/UPS, orMGRS, then the choice beteen UTM and UPS and the UTM zone mirrors the input. The-zzone,-s,-toptions allow these rules to be overridden withzone= 0 being used to indicate UPS. For example, the point 79.9S 6.1E corresponds to possible MGRS coordinates 32CMS4324728161 (standard UTM zone = 32) 31CEM6066227959 (neighboring UTM zone = 31) BBZ1945517770 (neighboring UPS zone) then 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 => BBZ1917NOTE: the letter in the zone specification for UTM is a hemisphere designatorNorSandnotan MGRS latitude band letter. Convert the MGRS latitude band letter to a hemisphere as follows: replaceCthruMbyS; replaceNthruXbyN.

**EXAMPLES**

echo 38SMB4488 | GeoConvert => 33.33424 44.40363 echo 38SMB4488 | GeoConvert -d -p 1 => 33d20'03.25"N 044d24'13.06"E echo 38SMB4488 | GeoConvert -u => 38N 444500 3688500 echo E44d24 N33d20 | GeoConvert -m -p -3 => 38SMB4488

**ERRORS**

An illegal line of input will print an error message to standard output beginning with "ERROR:" and causesGeoConvertto return an exit code of 1. However, an error does not causeGeoConvertto terminate; following lines will be converted.

**ABBREVIATIONS**

UTMUniversal Transverse Mercator, <http://en.wikipedia.org/wiki/Universal_Transverse_Mercator_coordinate_system>.UPSUniveral Polar Stereographic, <http://en.wikipedia.org/wiki/Universal_Polar_Stereographic>.MGRSMilitary Grid Reference System, <http://en.wikipedia.org/wiki/Military_grid_reference_system>.WGS84World Geodetic System 1984, <http://en.wikipedia.org/wiki/WGS84>.

**SEE** **ALSO**

GeoConvertis a part of GeographicLib, <http://geographiclib.sf.net>. The algorithms for the transverse Mercator projection are described in C. F. F. Karney,TransverseMercatorwithanaccuracyofafewnanometers, J. Geod (2011); DOI <http://dx.doi.org/10.1007/s00190-011-0445-3>; preprint <http://arxiv.org/abs/1002.1417>.

**AUTHOR**

GeoConvertwas written by Charles Karney.