Latitude, Longitude (degrees) to UTM and UPS projections

10 vues (au cours des 30 derniers jours)
S K
S K le 10 Fév 2012
Réponse apportée : ag le 6 Nov 2024 à 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. :)

Réponses (1)

ag
ag le 6 Nov 2024 à 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