why reference matrix is shown as empty matrix when I am reading a geo tiff file from matlab 2010a?

2 views (last 30 days)
I imported modis images(reprojected to geographic coordinate system) in matlab 2010.But, reference matrix is shown as empty one and I cant find geographic coordinate of interesting points. Plz can you explain where I was wrong and give a solution for me. Thanks.

Accepted Answer

Chad Greene
Chad Greene on 19 Dec 2014
I'm guessing your MODIS image is a plain tiff and not a geotiff. Sometimes there's a supporting text file that may have information about the coordinates of the image corners. Sometimes those corner coordinates are called the G-Ring or G-Polygon and you have to build the georeferencing matrix from that information. The landsat function tackles the same problem like this:
% Find G-polygon text in metadata file:
latind = regexp(txt,'G-Ring_Latitude');
lonind = regexp(txt,'G-Ring_Longitude');
% Get values of polygon vertices:
for k = 1:4
lats(k) = str2double(txt(latind(k)+17:latind(k)+27));
lons(k) = str2double(txt(lonind(k)+17:lonind(k)+27));
end
% Create georasterref:
R = georasterref('LatLim',[min(lats) max(lats)],...
'LonLim', [min(lons) max(lons)], ...
'RasterSize', size(I),'ColumnsStartFrom','north');

More Answers (0)

Community Treasure Hunt

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

Start Hunting!