How to use matrix and MapCellsReference to create a map?

8 visualizaciones (últimos 30 días)
Pai-Feng Teng
Pai-Feng Teng el 1 de Dic. de 2019
Comentada: Jake Stocki el 20 de Jul. de 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.

Respuestas (0)

Community Treasure Hunt

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

Start Hunting!

Translated by