how to convert GRS80 to WGS84?

16 次查看(过去 30 天)
hye wook Kim
hye wook Kim 2020-12-28
回答: Purvaja 2025-5-2
hello! I have problem with convert GRS80(EPSG:5179) dataset like X=959200, Y=1952800 into
WGS84 lon and lat...
Existing functions(utm2ll or utm2ell) give me wrong lat and lon!
they give me lat:17.448, lon:137.7768 while real answer is lat:37.3315, lon:126.4550
Is there any function for converting meter based GRS80 into lon and lat?

回答(1 个)

Purvaja
Purvaja 2025-5-2
I understand that you need to convert X–Y coordinates defined on the GRS80-based / Unified CS (EPSG:5179) back into geographic WGS84 latitude and longitude, and that existing UTM-based helpers like utm2ll are giving you different results than expected.
The simplest approach in MATLAB is to use the Mapping Toolbox’s PROJ-based functions:
  1. Create the EPSG:5179 CRS object with projcrs.
  2. Invert your X–Y to latlon using projinv.
Follow the below code regarding execution:
% 1. Create the EPSG:5179 projected CRS object
p5179 = projcrs(5179, "Authority", "EPSG");
% 2. Your input X–Y in meters
X = 959200;
Y = 1952800;
% 3. Unproject to latitude and longitude (in degrees)
[lat, lon] = projinv(p5179, X, Y);
% 4. Display results
fprintf('Latitude: %.6f°\nLongitude: %.6f°\n', lat, lon);
For more clarifications refer to following documentation links:
  1. Projcrs : https://www.mathworks.com/help/map/ref/projcrs.html
  2. Projfwd: https://www.mathworks.com/help/map/ref/projcrs.projfwd.html
For version specific MATLAB documentation links type following commands in MATLAB command window:
web(fullfile(docroot, '/map/ref/projcrs.html'))
web(fullfile(docroot, '/map/ref/projcrs.projfwd.html'))
In case of any minute discrepancies between the obtained results and actual result refer to the following MATLAB answer link to understand why it is so:
Hope this helps you!

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by