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'
Mohammad Abouali (2021). parseLandSat8MetaData(filename) (https://www.mathworks.com/matlabcentral/fileexchange/48614-parselandsat8metadata-filename), MATLAB Central File Exchange. Retrieved .
Inspired: How to drape Landsat images over Bedmap2 topography, L8read Landsat 8 Level 1 tiff reader, landsat
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Create scripts with code, output, and formatted text in a single executable document.
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
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);