[Proj] Proj4 cs2cs Program and the Geocentric Coord System

Karney, Charles ckarney at Sarnoff.com
Wed Feb 4 11:58:56 EST 2009


Ung wrote:
> Hi All,
>
> I found that running the following command:
> cs2cs +proj=geocent +ellps=WGS84 +to +proj=geocent +ellps=WGS84
>
> with input "123 655 123" yields "-122.87 -654.29 -122.86"

As Frank points out many algorithms to deal with geocentric coordinates
break down within 50km of the center of the earth.  If you need to do
such conversions accurately use ECEFConvert from

  http://charles.karney.info/geographic/

After compiling ECEFConvert, you can do

 echo 123 655 123 | ./ECEFConvert -r | ./ECEFConvert

which returns

 122.9999999999995 654.9999999999982 123.0000000002855

--
Charles Karney <ckarney at sarnoff.com>
Sarnoff Corporation, Princeton, NJ 08543-5300

URL: http://charles.karney.info
Tel: +1 609 734 2312
Fax: +1 609 734 2662


More information about the Proj mailing list