Latitude and Longitude Data to Universal Transverse Mercator (UTM)

37 ビュー (過去 30 日間)
Sérgio Querido
Sérgio Querido 2016 年 11 月 17 日
コメント済み: Kristoffer Walker 2022 年 10 月 19 日
Hi,
How can i convert this spreadsheet with xy gps coordinates (Latitude and Longitude) to Universal Transverse Mercator (UTM), in meters?

採用された回答

André Luiz Lourenço
André Luiz Lourenço 2021 年 4 月 13 日
編集済み: MathWorks Support Team 2022 年 6 月 6 日
************************************
Matlab has his own functions to deal with it.
First you need to get the utm zone from the coordinates
p1 = [lat,lon];
z1 = utmzone(p1)
Then you must get the geoid of this zone and construct the projection structcture using the following functions
[ellipsoid,estr] = utmgeoid(z1);
utmstruct = defaultm('utm');
utmstruct.zone = z1;
utmstruct.geoid = ellipsoid;
utmstruct = defaultm(utmstruct);
Finally you use mfwdtran to convert coordinates
[x,y] = mfwdtran(utmstruct,lat,lon)
  3 件のコメント
Honey
Honey 2021 年 11 月 22 日
Hello .
I have a problem with this code in zone part. I know that my lat and lon data is located in 40 zone of north hemisphere. But this code is showing me z1= 40S. what's the matter?
Kristoffer Walker
Kristoffer Walker 2022 年 10 月 19 日
The above codes do not work when I use lat=29 and lon=-126

サインインしてコメントする。

その他の回答 (1 件)

KSSV
KSSV 2016 年 11 月 18 日
Load the data into matlab and use the following function to convert degrees to utm.
YOu can load data from excel to matlab using xlsread.
  2 件のコメント
Sérgio Querido
Sérgio Querido 2016 年 11 月 18 日
編集済み: Sérgio Querido 2016 年 11 月 18 日
close all clear all workspace
%% ext='.xlsx'; filename1='João Carlos.xlsx'
%% Leitura Ficheiros
data_MOM1=xlsread(filename1,'MOMENTO1');
datautm_MOM1= wgs2utm(data_MOM1)
What's wrong in the code?
"Error using wgs2utm (line 68) Wrong number of input arguments
Error in newroutine (line 10) datautm_MOM1= wgs2utm(data_MOM1)"
KSSV
KSSV 2016 年 11 月 18 日
Lat = data_MOM(:,1) ; % is X latitude? check
Lon = data_MOM(:,2) ; % is Y longitude? Check
[x,y,utmzone]= wgs2utm(Lat,Lon) ;

サインインしてコメントする。

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by