Questions about 'geotiffwrite'

조회 수: 3 (최근 30일)
rui gao
rui gao 2019년 6월 28일
댓글: Peter 2019년 11월 14일
Hello, any suggestions would be appreciated.
I use matlab to read '*.tif' (DEM), and do some data processing. After the processing, I want to output the matrix with the same format as the previous file. The code below works for some area, but for some other areas, it doesn't work, and it shows the hint below (after the code).
Does this relate to the projected coordinate system? Or should I re-project the DEM data, and process the data in matlab after that?
% input
[t,R] = geotiffread(filename);
info = geotiffinfo(filename);
geoTags = info.GeoTIFFTags.GeoKeyDirectoryTag;
% ... I did some change for the matrix, t. T denotes the modified t
% output
geotiffwrite(output_tif_name,T,R,'GeoKeyDirectoryTag',geoTags);
Error using geotiffwrite (line 257)
Expected the 'GeoKeyDirectoryTag.ProjectedCSTypeGeoKey' field value to indicate a numeric value for a known projected
coordinate system.
  댓글 수: 2
rui gao
rui gao 2019년 6월 29일
It seems that re-projecting the DEM data (raster) is a way.
Let me check whether matlab can solve this. I don't understand the principle behind the function.
Peter
Peter 2019년 11월 14일
This type of approach used to work in previous versions of matlab, as I used it often and worked fine. But after a recent matlab update it does not work. Hopefully matlab will fix it.
In my case from the file I read, generated in Global Mapper software, I have
uas_info.GeoTIFFTags.GeoKeyDirectoryTag.ProjectedCSTypeGeoKey
ans = 6348
but then get the same error as the orginal post, when I try to write with this value.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Mapping Toolbox에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by