File Exchange

image thumbnail

parseLandSat8MetaDa​ta(filename)

version 1.3.0.0 (2.82 KB) by Mohammad Abouali
Parsing LandSat 8 Meta Data

2 Downloads

Updated 02 Dec 2014

View License

This function parses the meta data of Land Sat 8 and returns all fields as a structure.
Example:
mdata=parseLandSat8MetaData('LC80270292014198LGN00_MTL.txt')
disp(mdata.L1_METADATA_FILE.PROJECTION_PARAMETERS)
MAP_PROJECTION: 'UTM'
DATUM: 'WGS84'
ELLIPSOID: 'WGS84'
UTM_ZONE: 15
GRID_CELL_SIZE_PANCHROMATIC: 15
GRID_CELL_SIZE_REFLECTIVE: 30
GRID_CELL_SIZE_THERMAL: 30
ORIENTATION: 'NORTH_UP'
RESAMPLING_OPTION: 'CUBIC_CONVOLUTION'

Comments and Ratings (3)

Hi,
Regarding the error "Undefined function 'strsplit' for input arguments of type 'char'"

STRSPLIT is an internal MATLAB function introduced in version 2013a. If you are using an older version of MATLAB, then you need to upgrade to version 2013a or a newer one. If your MATLAB already satisfies the minimum version requirement then you need to check your MATLAB installation and see why STRSPLIT is not accessible.

You can read more on this function at the following link:
http://www.mathworks.com/help/matlab/ref/strsplit.html

dEns

Undefined function 'strsplit' for input arguments of type 'char'.
Hi Mohammad - I get this error message when I try to run your code. Can you help me with this? Thanks.

Error in parseLandSat8MetaData (line 45)
lineFields=strsplit(lineStr,'=');

Error in loadLandSat8 (line 59)
metaData=parseLandSat8MetaData(metaFileName);

Updates

1.3.0.0

- just adding a photo for this file.

1.2.0.0

- Making sure all groups and sub groups where processed properly (So there was an END_GROUP for each GROUP.)

1.1.0.0

- Removing a bug in the code that was complaining about meta data although it was complete.

MATLAB Release Compatibility
Created with R2014b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Tags Add Tags