Pages

jeudi 5 avril 2012

conversion XYZ to Latitude/longitude

I looked for a software to convert from XYZ to latitude/longitude, and found a good tool from internet.

---From the website http://www.ngs.noaa.gov/PC_PROD/XYZWIN/, I downloaded a ZIP'ed archive that includes the C source code, and all documentation.


---make xyz2llh
(remove the *.o if they exist, then compile the code)


-- test with ./run3.csh,  ./run2.csh and ./run1.csh. It should work


Note:
0)  ./xyz2llh
xyz2llh(1.5 02/02/07): Converts X Y Z to lat, lon and ellipsoid hgt
Usage: xyz2llh X Y Z
  options:
           -d print deg min sec rather than decimal degrees.
           -h prints this message.
           -r = input coordinates are lat, lon, hgt,
                output coordinates will be X, Y, Z.
           -w longitudes are west rather than east longitude.

1) example:
./xyz2llh -w  -5246403.93847269, -3077285.30866971, -1913839.28749343
results:  lat=-17.5770292180   long=149.6061879567     hight=99.81636

Attention: this code does not require the definition of reference Ellipsoide, and it uses WGS84 by default. Sometimes we may be interested in other option, such as ITRF2005, which is however not used by this code. The results between using different  reference Ellipsoide could be large, eg., 50 cm difference at height.







Aucun commentaire:

Enregistrer un commentaire