geotiffread and plot example leads to errors

13 ビュー (過去 30 日間)
Paul Huter
Paul Huter 2017 年 5 月 3 日
コメント済み: Kashish Sadhwani 2021 年 1 月 22 日
I am trying to follow this example:
with a GeoTIFF from:
However, when I use this code:
[A, R] = geotiffread('MODAL2_D_CLD_FR_2017-01-01_rgb_3600x1800.tiff');
and then try to plot with:
mapshow(A, R)
I get a string of errors:
_Error using checkRefObj (line 25) Function mapshow expected input number 2, R, to be either a 3-by-2 referencing matrix or a scalar map raster reference object. Instead its size was 256x3.
Error in validateMapRasterData>parseImageInputs (line 112) refmat = checkRefObj(mapfcnname, R, size(A), R_position);
Error in validateMapRasterData>validateImageComponent (line 92) [A, R] = parseImageInputs(mapfcnname, dataArgs{:}, cmap, rules );
Error in validateMapRasterData (line 26) [Z, SpatialRef] = validateImageComponent(mapfcnname, ...
Error in maprastershow (line 127) validateMapRasterData('mapshow', dataArgs, displayType, HGpairs);
Error in mapshow (line 228) h = showFcn(varargin{:});_
Any thoughts?
  1 件のコメント
Kashish Sadhwani
Kashish Sadhwani 2021 年 1 月 22 日
Did you solve the problem?
I am facing same issue as after loading tiff file mapshow is showing following error.
Thanks in Advance
Error using checkRefObj (line 25)
Function mapshow expected input number 2, R, to be either a 3-by-2 referencing
matrix or a scalar map raster reference object. Instead its type was:
map.rasterref.GeographicCellsReference.
Error in checkRegularDataGrid (line 17)
R = checkRefObj(fcnName, R, size(Z), 2);
Error in validateMapRasterData>validateGridComponent (line 183)
[Z, SpatialRef] = checkRegularDataGrid(dataArgs{:}, mapfcnname);
Error in validateMapRasterData (line 30)
[Z, SpatialRef] = validateGridComponent(mapfcnname, ...
Error in maprastershow (line 131)
validateMapRasterData('mapshow', dataArgs, displayType, HGpairs);

サインインしてコメントする。

回答 (3 件)

Chaitral Date
Chaitral Date 2017 年 5 月 9 日
編集済み: Chaitral Date 2017 年 5 月 9 日
How are you downloading the GeoTIFF file from the below site?
https://neo.sci.gsfc.nasa.gov/view.php?datasetId=MODAL2_D_CLD_FR&date=2017-03-01

Harsh
Harsh 2017 年 5 月 11 日
Hello Paul,
If you still need help with this, please contact MathWorks Technical Support here: https://www.mathworks.com/support/contact_us/
Please be sure to provide a detailed description of the issue and attach any relevant files / code / examples required to investigate the issue.

Paul Huter
Paul Huter 2017 年 5 月 11 日
There are two types of tiffs, a floating point and a raster, on that site. I found out I need to load one for A and the other for R to get A in uint8 and R in the right format. Cumbersome, but now I got it to plot.

Community Treasure Hunt

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

Start Hunting!

Translated by