Latitude, Longitude (degrees) to UTM and UPS projections

조회 수: 10 (최근 30일)
S K
S K 2012년 2월 10일
답변: ag 2024년 11월 6일 10:10
I need a function to convert latitude, longitude to UTM and UPS systems and convert them back to latitude and logitude. Please let me know if someone has developed it already. :)

답변 (1개)

ag
ag 2024년 11월 6일 10:10
Hi SK,
To convert latitude and longitude to the UTM or UPS coordinate system, you can utilize the Mapping Toolbox in MATLAB.
Below is an example code that demonstrates this process:
% Create a map projection structure for a UPS/UTM projection
mstruct = defaultm("ups");
% Specify map limits and a reference ellipsoid for the map projection structure.
% Populate additional fields of the structure based on the map limits using the defaultm function again.
mstruct.maplonlimit = [-150 -30];
mstruct.geoid = referenceEllipsoid("grs80", "kilometers");
mstruct = defaultm(mstruct);
% Load coastline data and trim it to the specified map limits.
% Project the latitude and longitude coordinates using the projfwd function and the map projection structure.
load coastlines
[lat, lon] = maptriml(coastlat, coastlon, mstruct.maplatlimit, mstruct.maplonlimit);
[x, y] = projfwd(mstruct, lat, lon);
% Display the projected coordinates on a Cartesian plot.
figure
plot(x, y)
axis equal
For more details, please refer to the following MathWorks documentation:
Hope this helps!

Community Treasure Hunt

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

Start Hunting!

Translated by