Questions about 'geotiffwrite'

35 vues (au cours des 30 derniers jours)
rui gao
rui gao le 28 Juin 2019
Commenté : Peter le 14 Nov 2019
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 commentaires
rui gao
rui gao le 29 Juin 2019
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 le 14 Nov 2019
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.

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Text Data Preparation dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by