NAME

CartConvert -- convert geodetic coordinates to geocentric or local cartesian


SYNOPSIS

CartConvert [ -r ] [ -l lat0 lon0 h0 ] [ -e a r ] [ --version | -h | --help ]


DESCRIPTION

Convert geodetic coordinates to either geocentric or local cartesian coordinates. Geocentric coordinates have the origin at the center of the earth, with the z axis going thru the north pole, and the x axis thru latitidude = 0, longitude = 0. By default, the conversion is to geocentric coordinates. Specifying -l lat0 lon0 h0 causes a local coordinate system to be used with the origin at latitude = lat0, longitude = lon0, height = h0, z normal to the ellipsoid and y due north.

Geodetic coordinates are provided on standard input as a set of lines containing (blank separated) latitude, longitude (decimal degrees or degrees, minutes and seconds), and height (meters). For each set of geodetic coordinates, the corresponding cartesian coordinates x, y, z (meters) are printed on standard output.


OPTIONS

-r

perform the reverse projection. x, y, z are given on standard input and each line of standard output gives latitude, longitude, height.

-e

specify the ellipsoid via a r; the equatorial radius is a and the reciprocal flattening is r. Setting r = 0 results in a sphere. Specify r < 0 for a prolate ellipsoid. By default, the WGS84 ellipsoid is used, a = 6378137m, r = 298.257223563.

--version

print version.

-h

print usage.

--help

print full documentation.


EXAMPLES

   echo 33.3 44.4 6000 | CartConvert
   => 3816209.60 3737108.55 3485109.57
   echo 33.3 44.4 6000 | CartConvert -l 33 44 20
   => 37288.97 33374.29 5783.64
   echo 30000 30000 0 | CartConvert -r
   => 6.483 45 -6335709.73


ERRORS

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


SEE ALSO

CartConvert is a part of GeographicLib, http://geographiclib.sf.net. The algorithm for converting geocentric to geodetic coordinates is given in Appendix B of C. F. F. Karney, Geodesics on an ellipsoid of revolution, Feb. 2011; preprint http://arxiv.org/abs/1102.1215.


AUTHOR

CartConvert was written by Charles Karney.