geotiff2mstruct - Convert GeoTIFF information to map projection structure
Syntax
mstruct = geotiff2mstruct(proj)
Description
mstruct = geotiff2mstruct(proj) converts
the GeoTIFF projection structure, proj, to the
map projection structure, mstruct. The unit of
length of the mstruct projection is meter.
Example
% Compare inverse transform of points using projinv and minvtran.
% Obtain the projection structure of 'boston.tif'.
proj = geotiffinfo('boston.tif');
% Convert the corner map coordinates to latitude and longitude.
x = proj.CornerCoords.X;
y = proj.CornerCoords.Y;
[latProj, lonProj] = projinv(proj, x, y);
% Obtain the mstruct from the GeoTIFF projection.
mstruct = geotiff2mstruct(proj);
% Convert the units of x and y to meter to match projection units.
x = unitsratio('meter','sf') * x;
y = unitsratio('meter','sf') * y;
% Convert the corner map coordinates to latitude and longitude.
[latMstruct, lonMstruct] = minvtran(mstruct, x, y);
% Verify the values are within a tolerance of each other.
abs(latProj - latMstruct) <= 1e-7
abs(lonProj - lonMstruct) <= 1e-7
ans =
1 1 1 1
ans =
1 1 1 1
See Also
axesm, defaultm, geotiffinfo, projfwd, projinv, projlist
 | geoshow | | geotiffinfo |  |
Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
Get the Interactive Kit