添付されたpngからMatlabでgeoTIFFファイルを作成しようとしています。ので、これをacheiveするmakerefmatとworldfilewriteを使用して、 https://uk.mathworks.com/help/map/examples/exporting-images-and-raster-grids-to-geotiff.htmlMatlabの画像からgeoTIFFを作成する
が、最初から地理参照情報を作成する必要があります。 example image は私が中に提供された例を、以下のよ。以下のコードはクラッシュを引き起こすことはありませんが、画像読者が苦労しているようなTIFFを生成するので、何か間違っていると思います。以前はTIFFタグで作業していなかったので、いくつかの冗長性があるかもしれません。どんな助けにも感謝!
% Load image without georeferencing
RGB = imread('uk_dT.png');
% Create worldfile for image. At present this is done by first creating a
% reference matrix, then using these values to generate a worldfile.
% Longitude spans -17:10 (west to east), latitude 63:47 (north to south)
lonmin = -17; lonmax = 10; latmin = 47; latmax = 63;
DX = (lonmax-lonmin)/(length(RGB(1,:,1))); DY = (latmin-latmax)/(length(RGB(:,1,1)));
R = makerefmat(lonmin, latmax, DX, DY);
worldfilewrite(R,'uk_dT.tfw');
% Read worldfile, create geotiff
REF = worldfileread('uk_dT.tfw','geographic',size(RGB));
geotiffwrite('uk_dT.tif',RGB,REF)