Questions about 'geotiffwrite'

8 ビュー (過去 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 Center および File ExchangeLogical についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by