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

Error running the lsDownload function #4

Open
ritaaframos opened this issue Jul 30, 2020 · 2 comments
Open

Error running the lsDownload function #4

ritaaframos opened this issue Jul 30, 2020 · 2 comments

Comments

@ritaaframos
Copy link

I am using the lsSearch and lsDownload function for some weeks now to obtain the landsat images from several seasons and years. It was working fine (mostly) but now I get an error I can't figure out:

#search images with cloud cover less than 30%
PB2014 <- lsSearch(product = "LANDSAT_8_C1",
startDate = as.Date("15-07-2014", "%d-%m-%Y"),
endDate = as.Date("15-09-2014", "%d-%m-%Y"),
cloudCover = c(0,30),
username = "username",
password = "password",
extent = postbreeding) #area, may be raster or poligon

#download the data
lsDownload(searchres = PB2014, #with the test layer
username = "username",
password = "password",
untar = FALSE,
raw.rm = FALSE,
AppRoot = wdir_pb14,
nattempts = 5)

Downloading the images in: /home/ritaramos/Desktop/NDVI/postbreebing2014/Landsat8/raw
Starting Landsat level 1 download process...
Error in charToRaw(enc2utf8(val)) :
argument must be a character vector of length 1

was there a change in the package recently that requires a change in the script?

All the best,

@mattols
Copy link

mattols commented Nov 4, 2020

I am getting the same error, but only for lvl=1 products. After poking around a bit, it seems like the error might be occurring in the 'startUSGSsession()" function in 'lsStartSession.R'
I'm not too familiar with requests and html, but the "csrf" (Line 17 of lsStartSession.R) variable seems to have no value. Perhaps the login webpage format has changed?
Changing 'csrf_token' to 'csrf' provides a value, but then I get a 404 Error.

@mkln
Copy link

mkln commented Feb 20, 2022

Getting the same error running the example from the docs

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

3 participants