I want to read and view geotiff in matlab but I could not open the file 'AddisAbaba.tif' file. Any help please?
17 views (last 30 days)
Show older comments
geremew lamessa
on 19 Jun 2018
Commented: Stephen Blackstock
on 15 Apr 2020
Here is the command I have used
[AddisAbaba,R] = geotiffread('AddisAbaba.tif');
figure
mapshow(AddisAbaba,R);
axis image off
but i have got error of the following error
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 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 126) [Z, SpatialRef, displayType, HGpairs] = ...
Error in mapshow (line 228) h = showFcn(varargin{:});
Error in DEM (line 5) mapshow(AddisAbaba,R);
0 Comments
Accepted Answer
Kojiro Saito
on 19 Jun 2018
Your GeoTIFF seems to be geographic reference data, so how about trying geoshow instead of mapshow?
The following codes would work.
[AddisAbaba,R] = geotiffread('AddisAbaba.tif');
figure
geoshow(AddisAbaba,R);
axis image off
1 Comment
Stephen Blackstock
on 15 Apr 2020
This doesn't work if the image is MxNx4, as in my case (it has an alpha channel).
More Answers (0)
See Also
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!