Why do my UTM WGS84 calculations not match what MATLAB has calculated?
9 次查看(过去 30 天)
显示 更早的评论
I have longitude and latitude data and I have converted them to UTM using WGS 84 standards. When I compare these to the UTM values generated from my lat and long they do not match. Default values for my conversion are from
<http://www.cellspark.com/UTM.html>
For example:
test=defaultm('utm');
utmzone=35;
origin=(utmzone-31).*6+3;
test.origin=[0 origin 0];
test=defaultm(test);
[eastutm2,northutm2]=mfwdtran(test,44.3536,28.4981);
%default values taken from manual lat -> UTM conversion
diffnorth2=4912239-northutm2
diffeast2=619393.56-eastutm2
采纳的回答
MathWorks Support Team
2013-7-3
This difference occurs because MATLAB’s default reference ellipsoid is "International", not "WGS 84"
Although people often use UTM with WGS 84, UTM was originally specified to work the various ellipsoids in different parts of the world, and the toolbox honors this specification.
The following code is accurate to within a few centimeters.
mUtm=defaultm('utm');
mUtm.zone = '35T';
mUtm.geoid = almanac('earth','wgs84','meters');
mUtm=defaultm(mUtm);
[eastutm2,northutm2]=mfwdtran(mUtm,44.3536,28.4981);
%default values taken from manual lat -> UTM conversion
diffnorth2=4912239-northutm2
diffeast2=619393.56-eastutm2
% Perform inverse mapping to verify lat and lon
[lat, lon] = minvtran(mUtm, eastutm2,northutm2)
Note that starting in MATLAB 7.14 (R2012a), it is recommended to use the wgs84Ellipsoid function instead of almanac . To do so, replace the line containing the almanac function with the following:
mUtm.geoid = wgs84Ellipsoid('meters');
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Universal Transverse Mercator System 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!