Documentation Center

  • 評価版
  • 製品アップデート

geotiffread

Read GeoTIFF file

Syntax

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

Description

[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.

X

Indexed image

cmap

Colormap

refmat

Referencing matrix

bbox

Bounding box

Examples

Read and display the Boston GeoTIFF image:

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

boston.tif copyright © GeoEye™, all rights reserved.

More About

expand all

Tips

  • geotiffread imports pixel data using the TIFF-reading capabilities of the MATLAB function imread and likewise shares any limitations of imread. Consult the imread documentation for information on TIFF image support.

See Also

| | | |

Was this topic helpful?