How can I load a tif file and save it again with the same parameters as before?
I want to load a tif file and save it again, but the saved file is not the same like the original file. helgoland_bathy.tif is a bathymetry map with georeferenced coordinates. The problem is that the second file has the wrong entries in the info parameter. Like PixelScale, RefMatrix and so on. It is possble to get all ifnormation from the tif file and save this again as a new tif with the identical information?
infilename = ‘helgoland_bathy.tif’;
[A,R] = readgeoraster(infilename);
info = geotiffinfo(infilename);
geoTags = info.GeoTIFFTags.GeoKeyDirectoryTag;
geotiffwrite(‘helgoland_bahty_2.tif’,A,R,’GeoKeyDirectoryTag’,geoTags)I want to load a tif file and save it again, but the saved file is not the same like the original file. helgoland_bathy.tif is a bathymetry map with georeferenced coordinates. The problem is that the second file has the wrong entries in the info parameter. Like PixelScale, RefMatrix and so on. It is possble to get all ifnormation from the tif file and save this again as a new tif with the identical information?
infilename = ‘helgoland_bathy.tif’;
[A,R] = readgeoraster(infilename);
info = geotiffinfo(infilename);
geoTags = info.GeoTIFFTags.GeoKeyDirectoryTag;
geotiffwrite(‘helgoland_bahty_2.tif’,A,R,’GeoKeyDirectoryTag’,geoTags) I want to load a tif file and save it again, but the saved file is not the same like the original file. helgoland_bathy.tif is a bathymetry map with georeferenced coordinates. The problem is that the second file has the wrong entries in the info parameter. Like PixelScale, RefMatrix and so on. It is possble to get all ifnormation from the tif file and save this again as a new tif with the identical information?
infilename = ‘helgoland_bathy.tif’;
[A,R] = readgeoraster(infilename);
info = geotiffinfo(infilename);
geoTags = info.GeoTIFFTags.GeoKeyDirectoryTag;
geotiffwrite(‘helgoland_bahty_2.tif’,A,R,’GeoKeyDirectoryTag’,geoTags) tif MATLAB Answers — New Questions