MATLAB: Geotiffread & getting latlon info

geotiffreadlatlonMapping Toolboxpix2latlonreference matrix

Hello,
I am using EO-1 Hyperion data (hyperspectral) as a geotiff image data of Agatti Islands, Lakshadweep, India. I used geotiffread to read the image data.. using [img, RfrncMtrx, BndgBx]=geotiffread(phileName{:}); When I want to convert from the row/col to lat/lon by using pix2latlon, I get the numbers in map-scale. (Actually the values in the reference matrix are also huge!!!???). The BndgBx=[179100, 1155270; 206430, 1244100]..
Kindly let me know where I am going wrong?
Cheers
Raghu

Best Answer

Hi Raghu,
As background information, the coordinates of your image are in a projected coordinate system rather than a geographic coordinate system. You can use the function GEOTIFFINFO to return the information structure.
You will see the 'ModelType' field set to 'ModelTypeProjected'; therefore, the RefMatrix is also referenced to map coordinates.
Beginning in R2011a, you will also see a new field, SpatialRef, which in this case will contain a spatialref.MapRasterReference object.
If you want to find the geographic coordinates from the map coordinates, then you need to use the function PROJINV to unproject the coordinates to latitude and longitude.
Here is how you would find the latitude and longitude values for the center of the first pixel in boston.tif:
info = geotiffinfo('boston.tif');
[x,y] = pix2map(info.RefMatrix, 1, 1);
[lat,lon] = projinv(info, x,y)
Beginning in R2011a, you can use:
[x,y] = pix2map(info.SpatialRef, 1, 1)
or
R = info.SpatialRef;
[x,y] = R.intrinsicToWorld(1,1);
followed by:
[lat,lon] = projinv(info, x,y);
I hope this help you.
-Kelly