[A, R] = geotiffread(filename) reads a georeferenced grayscale, RGB, or multispectral image or data grid from the GeoTIFF file specified by filename into A and constructs a spatial referencing object, R.
[X, cmap, R] = geotiffread(filename) reads an indexed image into X and the associated colormap into cmap, and constructs a spatial referencing object, R. Colormap values in the image file are rescaled into the range [0,1].
[A, refmat, bbox] = geotiffread(filename) reads a georeferenced grayscale, RGB, or multispectral image or data grid into A; the corresponding referencing matrix into refmat; and the bounding box into bbox.
[X, cmap, refmat, bbox] = geotiffread(filename) reads an indexed image into X, the associated colormap into cmap, the referencing matrix into refmat, 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.
[...] = geotiffread(filename, idx) reads one image from a multi-image GeoTIFF file.
[...] = geotiffread(url, ...) reads the GeoTIFF image from a URL.
Input Arguments
filename
String that specifies the name of the GeoTIFF file. filename can include the folder name. Otherwise, the file must be in the current folder or in a folder on the MATLAB® path. If the named file includes the extension '.TIF' or '.TIFF' (either upper or lowercase), you can omit the extension from filename.
idx
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.
Default: First image in the file
url
Internet URL. The URL must include the protocol type (e.g., "http://").
Output Arguments
A
Two-dimensional array, if the file contains a grayscale image or data grid. An M-by-N-by-P array, if the file contains a color image, multispectral image, hyperspectral image, or data grid. The class of A depends on the storage class of the pixel data in the file, which is related to the BitsPerSample property as returned by the imfinfo function.
R
Geographic raster reference object if the image or data grid is referenced to a geographic coordinate system, or a map raster reference object if it is referenced to a projected coordinate system.