ecef to wgs84 #2488
-
Hello, I am trying to convert the ecef coordinates to wgs84. The code is as follows:
When I pass in the coordinates of ecef as (-1975.254792, -3609.488278, -6252.416188), The result I get is (-118.6892,-56.8018,1121637.77781), which is different from the result I get from some online coordinate conversion tool, which gets (-56.80184(latitude),241.31078,1121637.8). What improvements do I need to make? Thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
The canonical way to convert between WG84 and ECEF is like so: auto wgs84 = SpatialReference::get("wgs84");
auto ecef = wgs84->getGeocentricSRS();
GeoPoint ecef_point(ecef_srs, src);
GeoPoint wgs84_point = ecef_point.transform(wgs84); Also, your test ECEF coordinates look out of range to me. |
Beta Was this translation helpful? Give feedback.
-
Thanks you! |
Beta Was this translation helpful? Give feedback.
The canonical way to convert between WG84 and ECEF is like so:
Also, your test ECEF coordinates look out of range to me.