How to use matrix and MapCellsReference to create a map?

3 vues (au cours des 30 derniers jours)
Pai-Feng Teng
Pai-Feng Teng le 1 Déc 2019
Commenté : Jake Stocki le 20 Juil 2021
Hello everyone,
After my works, I figured out how to create the matrices. However, I wanted to save them into the tif file that can be opend as the raster data by QGIS. I created the georeference data when I input my original raster data,
[p01,R] =geotiffread('~/rasters/p201501.tif')
but they told me that the R is MapCellsReference, not georeference. When I use geotiffwrite function, it did not work. If I just used R directly like following:
geotiffwrite('~/rasters/MeanOct16th.tif',MeanOct16th,R);
geotiffwrite('~/rasters/MeanOct16th.tif',MeanOct16th,R,'GeoKeyDirectoryTag',info.GeoTIFFTags.GeoKeyDirectoryTag);
The first code gives me the following answer:
'Error using geotiffwrite (line 257)
The input, R, is a map.rasterref.MapCellsReference object indicating that you are working in a
projected coordinate system. If so, then specify a projected coordinate system by setting the
appropriate values for the 'CoordRefSysCode' or 'GeoKeyDirectoryTag' optional parameters.'
The second code gave me the following answer"
'Its response is 'Undefined variable "info" or class "info.GeoTIFFTags.GeoKeyDirectoryTag".'
How do I save my matrix with MapCellsReferences as a readable raster data? Thank you.
  1 commentaire
Jake Stocki
Jake Stocki le 20 Juil 2021
Was this ever figured out? I am having the exact same issue

Connectez-vous pour commenter.

Réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by