How to use matrix and MapCellsReference to create a map?
3 views (last 30 days)
Show older comments
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 Comment
Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!