Questions about 'geotiffwrite'

22 次查看(过去 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 中查找有关 Text Data Preparation 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by