Latitude, Longitude (degrees) to UTM and UPS projections

10 次查看(过去 30 天)
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