How to save geotiff?

7 views (last 30 days)
Max Müller
Max Müller on 3 Nov 2017
Commented: Max Müller on 3 Nov 2017
Hello
My aim is to compute a new geotiff but I'm not able to save a geotiff. Ra and Rb are empty. A and B are geotiff with wgs84 and without worldfile.
First attempt:
[A, Ra] = geotiffread('dec_16_hh.tiff');
[B, Rb] = geotiffread('dec_16_hv.tiff');
if size(dec_16_hv) ~= size(dec_16_hh)
msgbox('Error. Images do not have same scale.');
end
dec_16_k0 = uint32(A).^2 + uint32(B).^2;
geotiffwrite('dec_16_k0.tif',dec_16_k0,Ra);
Error
Error using internal.map.convertToGeoRasterRef (line 39)
Function GEOTIFFWRITE expected input argument 3, 'R', to be a 3-element referencing vector, a 3-by-2 referencing
matrix, or a (scalar) geographic raster reference object.
Second attempt:
With ArcGIS I created a worldfile from the geotiff.
[A, Ra] = geotiffread('dec_16_hh.tiff');
[B, Rb] = geotiffread('dec_16_hv.tiff');
if size(dec_16_hv) ~= size(dec_16_hh)
msgbox('Error. Images do not have same scale.');
end
dec_16_k0 = uint32(A).^2 + uint32(B).^2;
R = worldfileread('dec_16_hh.tfw');
geotiffwrite('dec_16_k0.tif',dec_16_k0,R);
Error
Error using refmatToGeoRasterReference (line 138)
The referencing matrix supplied to function GEOTIFFWRITE specifies that the associated raster is rotated or skewed
with respect to the latitude/longitude system. Function GEOTIFFWRITE does not support this geometry.
The geotiff which I use are from Landsat 1 from Copernicus
Best regards Max
  2 Comments
KSSV
KSSV on 3 Nov 2017
Attach your images......
Max Müller
Max Müller on 3 Nov 2017
Hello KSSV, these are my images: Images

Sign in to comment.

Answers (0)

Tags

Community Treasure Hunt

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

Start Hunting!