File Exchange

image thumbnail

utm2lonlat

version 1.0.0.0 (4.47 KB) by Erwin
Functions to convert vectors containing UTM coordinates into Lat/Lon vectors (WGS84) and vice versa

20 Downloads

Updated 08 Nov 2013

View License

This submission contains vecorised versions of the functions "utm2deg" and "deg2utm" by Rafael Palacios. The input/output-behaviour of both functions is identically.

We were able to achieve following speedup with input vectors of 40000 points:
- deg2utm: 1.3
- utm2deg: 3.3466

Basic usage:

[Lat,Lon] = utm2deg(x,y,utmzone)

% Example 1:
% x=[ 458731; 407653; 239027; 230253; 343898; 362850];
% y=[4462881; 5126290; 4163083; 3171843; 4302285; 2772478];
% utmzone=['30 T'; '32 T'; '11 S'; '28 R'; '15 S'; '51 R'];
% [Lat, Lon]=utm2deg(x,y,utmzone);
% fprintf('%11.6f ',lat)
% 40.315430 46.283902 37.577834 28.645647 38.855552 25.061780
% fprintf('%11.6f ',lon)
% -3.485713 7.801235 -119.955246 -17.759537 -94.799019 121.640266

[x,y,utmzone] = deg2utm(Lat,Lon)

% Example 1:
% Lat=[40.3154333; 46.283900; 37.577833; 28.645650; 38.855550; 25.061783];
% Lon=[-3.4857166; 7.8012333; -119.95525; -17.759533; -94.7990166; 121.640266];
% [x,y,utmzone] = deg2utm(Lat,Lon);
% fprintf('%7.0f ',x)
% 458731 407653 239027 230253 343898 362850
% fprintf('%7.0f ',y)
% 4462881 5126290 4163083 3171843 4302285 2772478
% utmzone =
% 30 T
% 32 T
% 11 S
% 28 R
% 15 S
% 51 R

Comments and Ratings (3)

Bujee

Thank you. I tried again and again. But it does not work. Could anyone please do it for me?.
47.483 101.4468
46.8722 102.8617
46.8863 102.4068
46.5157 102.5472
46.3497 102.0937
It is converted using deg2utm like below.
684331.59 5261742.341
337049.7081 5193182.004
302436.9954 5195793.959
311849.1734 5154270.84
276384.8006 5137008.105

Thanks!

MATLAB Release Compatibility
Created with R2012b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Acknowledgements

Inspired by: utm2deg, deg2utm