-
Notifications
You must be signed in to change notification settings - Fork 21
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
Erroneous files when trying to bulk download NLCD files with sbtools in R #310
Comments
Oh wow -- that's interesting. It's sending you to the cloud file downloader for some reason. First thing is to double check you are on the latest sbtools. There's been change in that part of the package not that long ago. library(sbtools)
authenticate_sb()
f <- item_list_files(sb_id = '63935b30d34e0de3a1efe082', fetch_cloud_urls = FALSE)
fname <- f$fname
fname <- fname[grepl("txt", f$fname, ignore.case = TRUE)]
sbtools::item_file_download(sb_id = '63935b30d34e0de3a1efe082', names = fname,
destinations = fname,
dest_dir = '.', overwrite_file = TRUE) Seems to be working for me. I am authenticated and I am on VPN. Hopefully it's something simple? Let me know if you can get it going with an update and some fiddling and I can dig deeper and try to reproduce here. |
Thanks @dblodgett-usgs! By updating the sbtools package, I am able to run that chunk of code and get the actual NLCD datasets in my local dir. I am noticing that this download step doesn't work with sbtools when in a targets object using the Targets R package:
Error:
This error happens even after I successfully authenticate_sb(). Might you know why this is happening? Something about this download step being wrapped into a targets object is making it trickier the authenticate sb? These files are also large, and stemming from an S3 buckets in sciencebase, this may be adding a layer of security that targets cannot cut through. Details of `download_sb_file()` and `read_subset_LC_data()` below:
|
Specifically, this is happening because Another way to handle it would be to cache your sciencebase credentials with ?sbtools::authenticate_sb for the keyring details. |
Hello 👋
I am trying to bulk download all the National Land Cover Database 2019 Versions for the Years 2001 to 2019 from it's sciencebase data release using
sbtools
in R.When attempting to download all the NLCD files from that sciencebase data release using
item_file_download()
:sbtools::item_file_download(sb_id = '63935b30d34e0de3a1efe082', dest_dir = '.', overwrite_file = TRUE)
The download appears successful as I get all the same named files in my defined directory, however, when opening
*_CONUS.txt
files I am wanting to use, they all turn out to be unreadable html files as shown in this screenshot.This doesn't happen when I download manually from sciencebase.
Any chance someone know why this is happening and what I need to do to pull the correct NLCD txt files using sbtools?
The text was updated successfully, but these errors were encountered: