How can I convert utm coordinates to lat long in my script?

11 views (last 30 days)
Hi! I'm working on a satellite image in GeoTiff format, in which I'm measuring sst (sstcal in my MATLAB script). I have created the raster with the X and Y coordinates, and with this program I can paint the image and observe the thermal contrasts on the ocean surface. I have been trying to convert the coordinates of XY (UTM) to latitude longitude, and I can not find the solution. Could you help me?
%% Coordinates
RasterExtentInWorldX=R.RasterExtentInWorldX;
RasterExtentInWorldY=R.RasterExtentInWorldY;
XIntrinsicLimits=R.XIntrinsicLimits;
YIntrinsicLimits=R.YIntrinsicLimits;
SampleSpacingInWorldX=R.SampleSpacingInWorldX;
SampleSpacingInWorldY=R.SampleSpacingInWorldY;
X=RasterExtentInWorldX:SampleSpacingInWorldX:RasterExtentInWorldX+((XIntrinsicLimits(2)-1)*SampleSpacingInWorldX);
Y=RasterExtentInWorldY:SampleSpacingInWorldY:RasterExtentInWorldY+((YIntrinsicLimits(2)-1)*SampleSpacingInWorldY);
[XX,YY]=meshgrid(X,Y);
%%
pcolor(XX,YY,sstcal), shading flat, colormap('jet'), colorbar
Thank you.

Answers (1)

Walter Roberson
Walter Roberson on 30 Jan 2019

Products


Release

R2015a

Community Treasure Hunt

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

Start Hunting!