How to save geotiff?
7 views (last 30 days)
Show older comments
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.
Best regards Max
Answers (0)
See Also
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!