How can I use multiple zones for one defaultm?

2 次查看(过去 30 天)
Is there a way to define a single defaultm with several zones (for instance 6 adjacent UTM zones - say 22E, 22F, 23E, 23F, 24E and 24F)?
Some context:
I am working with a project where I need to go through different UTM zones. I am using the Mapping Toolbox for that.
As my original coordinates are [Lon Lat] I must first transform the coordinate to coordinates in the relevant UTM zone. I do this using the following code (for instance Lat = -50 and Lon = -40 - I picked these randomly just for the context):
z1 = utmzone([Lat Lon]); % choose zone according to the GPS position
[ellipsoid, estr]=utmgeoid(z1); % choose a geoid according to the zone
utmstruct = defaultm('utm'); % create a default UTM structure
utmstruct.zone = z1; % set the UTM zone in the UTM structure
utmstruct.geoid = ellipsoid; % set the ellipsoid in the UTM structure
utmstruct = defaultm(utmstruct); % set the new UTM structure as default (again?!)
[X, Y] = mfwdtran(utmstruct,Lat, Lon);
If I need to find Lat, Lon I then use:
[newLat, newLon] = minvtran(utmstruct, newX, newY);

回答(0 个)

产品


版本

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by