How to use matrix and MapCellsReference to create a map?

조회 수: 3 (최근 30일)
Pai-Feng Teng
Pai-Feng Teng 2019년 12월 1일
댓글: Jake Stocki 2021년 7월 20일
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
Jake Stocki
Jake Stocki 2021년 7월 20일
Was this ever figured out? I am having the exact same issue

댓글을 달려면 로그인하십시오.

답변 (0개)

Community Treasure Hunt

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

Start Hunting!

Translated by