I have a set of (x, y, z) points on a local coordinates system cartesian plan.
For only 3 of these N points, I have the corresponding WGS84 coordinates (latitude, longitude and altitude).
How can I convert each of the other points in lat/lng coordinates?
EDIT:
Here an example of dataset:
Point # | x, y, z | lat, lng, h |
---|---|---|
P1 | 0, 0, 0 | 43.88072176381581, 11.072238294111774, 53 |
P2 | 0, 12.24, 0 | 43.88099406334439, 11.072485923398222, 53 |
P3 | 32.42, 6.79, 0 | 43.88080644977896, 11.072808964924704, 53 |
P4 | -12.4, 1, 0.5 | ? |
P5 | 55, 8.02, 0.2 | ? |
P6 | 0.4, 3, 0 | ? |
P7 | 1.03, -187.4, 5 | ? |
Best Answer
I do it in the following way:
For first and last steps I will use pyproj (2.6.1).
For the second step, I wasn't able to find an open source tool but a great math paper (Huaien Zeng, Xing Fang, Guobin Chang and Ronghua Yang (2018) A dual quaternion algorithm of the Helmert transformation problem. Earth, Planets and Space (2018) 70:26).
I wrote a Python module to partial reproduce the algorithm presented there and published it in my github account (https://github.com/gabriel-de-luca/simil). You can download it to one directory of the Python interpreter Module Search Path, or in the same directory where you save the code that use it.
Returns the geodetic control points coordinates converted to geocentric:
Now let's find the parameters of the 3D linear transformation that better adjust source control points local cartesian coordinates to geocentric ones:
Returns:
Control points coordinates must be multiplied by 1.28 to be adjusted to target coordinates. I usually don't have such scale factor (maybe the sample data provided is not real). I usually force the transformation to be adjusted with a fixed scale factor of 1:
Returns:
Let's transform the source control points with these parameters. This is easier to me with coordinates instead of points so I transpose:
Returns:
There are (compensated) differences in meters. I hope the sample data provided is just not real at all. Now, transform all other points to geocentric and then to geodetic:
Wich returns what we was looking for: