MATLAB Answers

Writing the matlab matrix in geotiff, whats wrong with this script?

20 views (last 30 days)
Shakir Hussain
Shakir Hussain on 12 Jun 2018
Commented: Shakir Hussain on 13 Jun 2018
What I am making mistake here?
basename = 'test';
rasterSize = [890 751];
refmat = makerefmat( ...
'RasterSize', rasterSize, 'Latlim', [00.00 44.50], ...
'Lonlim', [67.50 105.0250]);
R = refmatToGeoRasterReference(refmat, rasterSize);
filename = [test '.tif'];
testttif = geotiffwrite(filename, test, R);
I am getting this error Error using horzcat Dimensions of matrices being concatenated are not consistent.


Sign in to comment.

Accepted Answer

KSSV on 12 Jun 2018
filename = ['test', '.tif'];


Shakir Hussain
Shakir Hussain on 12 Jun 2018
Dear KSSV thanks for your response but it pop up with (Error using geotiffwrite Too many output arguments) how to fix it
KSSV on 12 Jun 2018
Don't take output from geotiffwrite. Simply use:
geotiffwrite(filename, test, R);
Shakir Hussain
Shakir Hussain on 13 Jun 2018
yes, got your point but still getting more error.
Error using>validGeoRasterReference (line 86) R.RasterSize is inconsistent with rasterSize.
Error in (line 40) validGeoRasterReference(R, rasterSize, angleUnit), ...
Error in geotiffwrite>validateR (line 851) R =, rasterSize, angle_units, ...
Error in geotiffwrite>validateInputs (line 348) R = validateR(R, size(A), hasColorMap, type);
Error in geotiffwrite (line 238) [filename, A, cmap, R, Params] = validateInputs(filename, A, cmap, R, Params);

Sign in to comment.

More Answers (0)

Sign in to answer this question.

Translated by