Does MATLAB or the Image Processing Toolbox have a function that reads Landsat image files?

14 views (last 30 days)

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 27 Jun 2009
Landsat imagery is available in multiple data formats, most of which may be read with MATLAB or MATLAB toolboxes. You must first determine which format your data is in. Here are the most likely possibilities:
1. GeoTIFF -- Use GEOTIFFREAD function in the Mapping Toolbox or IMREAD in MATLAB. Note that GeoTIFF files have an image component and a geospatial component. IMREAD function in MATLAB can read only the image component. GEOTIFFREAD extracts georeferencing and geospatial coordinate system information, in addition to the imagery itself. Note that GEOTIFFREAD can not read a four layer GeoTIFF dataset.
2. HDF (Hierarchical Data Format) -- Use HDFREAD or HDFTOOL function in MATLAB.
3. LAN (older Erdas format) -- This format is no longer widely used. Either (1) construct your own code to read the simple, fixed-length header then call MULTIBANDREAD in MATLAB to extract the pixel values or (2) copy and use the subfunction LAN_READ from LANDSATDEMO in the Image Processing Toolbox. See the Image Processing Toolbox demo "Enhancing Multispectral Color Composite Images" (ipexlanstretch.m) for an example in which MULIBANDREAD is applied to a .LAN image.
4. IMG (Erdas Imagine native format) -- There is currently no support for this format in MATLAB. (If your data provider is using Imagine, request that they export in GeoTIFF instead.)

More Answers (1)

Chad Greene
Chad Greene on 12 Dec 2014
Other options include landsat for quick plots of low-res Landsat 8 images or geoimread which extends the functionality of geotiffread to allow loading only a region of large geotiff files, given by lat/lon or map x/y coordinates.

Community Treasure Hunt

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

Start Hunting!