フィルターのクリア

how to write matrix into geotiff format

3 ビュー (過去 30 日間)
fatema saba
fatema saba 2015 年 11 月 27 日
編集済み: fatema saba 2015 年 11 月 27 日
Hello, I have an image made in ArcGIS. its format is Geotiff. I raed it with below command in matlab:
[X, cmap, R] = geotiffread('sarea.tif')
Then I made some changes in matrix X. finally I decided to convert it to previous format (Geotiff) to read in ArcGIS. Therefore I used the below code:
geotiffwrite('aa.tif',X,cmap,R)
But I got the error:
??? Error using ==> geotiffwrite
Expected input number 2, X, to be one of these types:
uint8, uint16
Instead its type was single.
Error in ==> geotiffwrite>validateImage at 395
validateattributes(A, {'uint8','uint16'}, {'nonempty'}, ...
Error in ==> geotiffwrite>validateInputs at 343
[A, cmap] = validateImage(A, cmap);
Error in ==> geotiffwrite at 233
[filename, A, cmap, R, Params] = validateInputs( ...
I convert X to uint8 using
X=uint8(X)
But again I got the error:
geotiffwrite('aa.tif',X,cmap,R)
??? Error using ==> checkcmap at 16
Function GEOTIFFWRITE expected its third input argument CMAP to be a valid colormap. Valid
colormaps must be nonempty, double, 2-D matrices with 3 columns.
Error in ==> geotiffwrite>validateImage at 397
internal.map.checkcmap(cmap, mfilename, 'CMAP', 3)
Error in ==> geotiffwrite>validateInputs at 343
[A, cmap] = validateImage(A, cmap);
Error in ==> geotiffwrite at 233
[filename, A, cmap, R, Params] = validateInputs( ...
Why I got the error? What is problem? Thank you

回答 (0 件)

カテゴリ

Help Center および File ExchangeSurface and Mesh Plots についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by