필터 지우기
필터 지우기

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 CenterFile Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by