geotiffread - Read georeferenced image from GeoTIFF file

Syntax

A = geotiffread(filename)
[X, cmap] = geotiffread(filename)
[X, cmap, R, bbox] = geotiffread(filename)
[A, R, bbox] = geotiffread(filename)
[...] = geotiffread(filename, idx)
[...] = geotiffread(url, ...)

Description

A = geotiffread(filename) reads the GeoTIFF image in filename into A. If the file contains a grayscale image, A is a two-dimensional array. If the file contains a true-color (RGB) image, A is a three-dimensional (M-by-N-by-3) array.

filename is a string that specifies the name of the GeoTIFF file. filename can include the directory name; otherwise, the file must be in the current directory or in a directory on the MATLAB path. If the named file includes the extension .TIF or .TIFF (either upper- or lowercase), the extension can be omitted from filename.

[X, cmap] = geotiffread(filename) reads the indexed image in filename into X and its associated colormap into cmap. Colormap values in the image file are automatically rescaled into the range [0,1].

[X, cmap, R, bbox] = geotiffread(filename) reads the indexed image into X, the associated colormap into cmap, the referencing matrix into R, and the bounding box into bbox. The referencing matrix must be unambiguously defined by the GeoTIFF file; otherwise, it and the bounding box are returned empty ([]).

[A, R, bbox] = geotiffread(filename) reads the grayscale or RGB image into A, the referencing matrix into R, and the bounding box into bbox.

[...] = geotiffread(filename, idx) reads in one image from a multiimage GeoTIFF file. idx is an integer value that specifies the order that the image appears in the file. For example, if idx is 3, geotiffread reads the third image in the file. If you omit this argument, geotiffread reads the first image in the file.

[...] = geotiffread(url, ...) reads the GeoTIFF image from an Internet URL. The URL must include the protocol type (e.g., "http://").

Example

Read and display the Boston GeoTIFF image:

[boston, R, bbox] = geotiffread('boston.tif');
figure
mapshow(boston, R);
axis image off

boston.tif copyright © GeoEye, all rights reserved.

See Also

geotiffinfo, imread, mapview, mapshow, geoshow

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS