bleutner / RStoolbox

Remote Sensing Data Analysis in R 🛰
266 stars 82 forks source link

Duplicate row.names are not allowed. #81

Open aterhorst opened 2 years ago

aterhorst commented 2 years ago

I have an Apple Silicon MacBook.

p166r077 <- stackMeta("LC08_L2SP_166072_20210819_20210827_02_T1/LC08_L2SP_166072_20210819_20210827_02_T1_MTL.txt", ,quantity = "all", category = "image", allResolutions = FALSE)

returns the following error(s):

Error in `.rowNamesDF<-`(x, value = value) : 
  duplicate 'row.names' are not allowed
In addition: Warning message:
non-unique value when setting 'row.names': ‘QA_NA’ 
aterhorst commented 2 years ago

LC08_L2SP_166072_20210819_20210827_02_T1_MTL.txt

Metadata file.

aterhorst commented 2 years ago

I ran into the same issue on my windows machine. I tried a different Landsat 8 scene. No joy. I downloaded the data from EarthExplorer.

Rapsodia86 commented 2 years ago

Because it is Level2 product that readMeta() [which is inside stackMeta()] does not read properly when raw=FALSE as default. See #84

AbigailUribe commented 2 years ago

I am working with level1 products, but I have the same issue for some images.... please help! I really need to process dozens of images! I think it is because the processing level (this one is a Real Time product) but I hope it could work no matter what type of ancillary data it has. LC08_L1TP_019046_20220917_20220917_02_RT_MTL.txt

setwd(dir_image) meta_arch<-readMeta("LC08_L1TP_019046_20220917_20220917_02_RT_MTL.txt")

Error in .rowNamesDF<-(x, value = value) : duplicate 'row.names' are not allowed In addition: Warning message: non-unique values when setting 'row.names': ‘AUX_NA’, ‘QANA’

If I set raw to TRUE, it fails in the stackMeta: setwd(dir_image) meta_arch<-readMeta("LC08_L1TP_019046_20220917_20220917_02_RT_MTL.txt", raw =T) lsMeta <- stackMeta(meta_arch)

Error in file.exists(file) : invalid 'file' argument