[GIS] Cartesian coordinate convert to WGS84

cartesianwgs84

I am lost by various coordinate systems. This problem may be simple for you, but I still have no idea. A point P which WGS84 coordinate is (a, b, c). a, b, c represents longitude, latitude, altitude, respectively. The coordinates of the Q point relative to the P point in the Cartesian coordinate system are (x, y, z). My question is, how to find the WGS84 coordinates of Q point? Is there a formula or a third-party library?

For example, a gnss device record a few line data, likes

1571729100.288,$GPGGA,07,3020.13221706(latitude),N,12118.46433560(longitude),E,4,38,0.4,5.8393,M,11.4922(altitude),M,02,0249*6D
1571729100.288,$GPGGA,07,3020.13221706,N,12118.46433560,E,4,38,0.4,5.8393,M,11.4922,M,02,0249*6D
1571729100.488,$GNVTG,108.936,T,114.767,M,40.42729,N,74.87134,K,D*3B
1571729100.503,$GPGGA,072500.40,3020.13148649,N,12118.46679048,E,4,37,0.5,5.8416,M,11.4923,M,02,0249*6B
1571729100.704,$GNVTG,108.941,T,114.773,M,40.50145,N,75.00867,K,D*30
1571729100.704,$GPGGA,0760,3020.13075439,N,12118.46924982,E,4,37,0.5,5.8253,M,11.4924,M,01,0249*68
1571729100.905,$GNVTG,109.067,T,114.898,M,40.49335,N,74.99368,K,D*3E

a point P which WGS84 coordinate is ( 12118.46433560, 3020.13221706, 11.4922), a point Q relative to P is (3, 4, 5) in Cartesian coordinate, unit in meter. Other words, the distance between P and Q is sqrt(3*3+4*4+5*5) meters. I just want to know the Q coordinate in WGS84

Best Answer

I think the data's in the Philippines. Is that correct?

The latitude, longitude values are in DDMM.mmmmm, packed degree-decimal minute values. For example,

3020.13221706(latitude),N, = 30° 20.13221706 = 30.00220361767 12118.46433560(longitude),E = 121° 18.46433560 = 121.3077389267

This is confirmed by several sites like this one.

What you will need to do is

1. convert the packed degrees-decimal minutes values into decimal degrees.
2. convert the decimal degrees values into 3D Cartesian geocentric XYZ values with the ellipsoidal height values, not the above MSL/geoid values.
3. Add your xyz offsets.
4. Convert back to decimal degrees.

This question has python code for the conversions you'll need for steps 2 and 4.

Related Question