Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

readMeta fails to read Landsat 9 metadata (*MTL.txt) files #122

Open
chevanik opened this issue Feb 19, 2025 · 1 comment
Open

readMeta fails to read Landsat 9 metadata (*MTL.txt) files #122

chevanik opened this issue Feb 19, 2025 · 1 comment

Comments

@chevanik
Copy link

Hello,

I have been searching other threads in hopes to find an answer, but I am having a hard time doing so.
I am using Rstoolbox to process imagery from L9, L8, and L5 for a time series analysis.

I am using the most up to date package and Rstudio software.

LC09_L1TP_016032_20240301_20240301_02_T1_MTL.txt

My issues is with the MTL file for Landsat 9 imagery from March 2024. When performing the function to read in the metadata .txt. file, I keep encountering this error.

"> readMeta("E:/Ch1_veg_analysis/Landsat_master/Final_Scenes/LC09_L1TP_016032_20240301_20240301_02_T1_MTL.txt")
Error in rownames<-(*tmp*, value = tbds) :
attempt to set 'rownames' on an object with no dimensions"

I've also tried this iteration with no luck
" # 1a. Landsat 9; 03/01/2024

mtl9 <- paste0("E:/Ch1_veg_analysis/Landsat_master/Final_Scenes/LC09_L1TP_016032_20240301_20240301_02_T1_MTL.txt")
readMeta <- (mtl9) # read metadata file
summary(mtl9)
Length Class Mode
1 character character"

I've tried a few different iterations based on previous discussions here and on the geospatial data science in R website, and I'm at a loss with my troubleshooting. Any insight would be appreciated, apologies if I've missed any details - happy to correct if needed. Thanks

@aloboa
Copy link

aloboa commented Apr 2, 2025

I have the same problem with this LT05 meta file:
https://www.dropbox.com/scl/fi/sl76rhvx4umhxj4ldzvtk/LT05_L2SP_009054_19870130_20201014_02_T1_MTL.txt?rlkey=fbidtw2rcm3picchwhc2h5h48&dl=0
I have compared it to the one used in the help page
system.file("external/landsat/LT52240631988227CUB02_MTL.txt", package="RStoolbox")
and they are very different.

I presume older issues #81 and #84 refer to the same problem and thus that there is little hope anyone is going to fix this function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants