필터 지우기
필터 지우기

lat and lon from GEOTIFF when the matrix is not square

조회 수: 2 (최근 30일)
Farz Tak
Farz Tak 2016년 5월 20일
편집: Farz Tak 2016년 5월 20일
Hi, I have my geotiff file and want to extract lat and lon as: info = geotiffinfo(name); AX = info.Width; AY = info.Height; [y,x] = pix2map(info.RefMatrix, 1:AY, 1:AX); [lat,lon] = projinv(info, y,x);
But my AX and AY are not the same and it gives the error. Any help?
Thanks,
Farz

채택된 답변

Farz Tak
Farz Tak 2016년 5월 20일
편집: Farz Tak 2016년 5월 20일
I found it after a day:
info = geotiffinfo(path11);
function [lat,lon] = geo_coordinate(info)
AX = info.Width;
AY = info.Height;
[x1,y1] = pix2map(info.RefMatrix, 1:AY, ones(AY,1)');
[lat1,lon1] = projinv(info, x1,y1);
[x2,y2] = pix2map(info.RefMatrix, ones(AX,1)',1:AX);
[lat2,lon2] = projinv(info, x2,y2);
[lat,lon] = ndgrid(lat1,lon2);
1;

추가 답변 (0개)

제품

Community Treasure Hunt

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

Start Hunting!

Translated by