-
Notifications
You must be signed in to change notification settings - Fork 4
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
bm_raster
returns NULL
#13
Comments
@simon-smart88 Thanks for flagging the issue. Was testing now, and there seem to be some issues on the NASA LAADS archive. Will keep checking to see if the problem is with the code or with the archive that the code is trying to access — and at the very least aim to include some more helpful error messages when there seems to be issues with the LAADS archive. |
I think the problem still exists. Any improvements? Below my codes: roi_sf <- gadm(country = "GHA", level=1, path = tempdir()) Daily data: raster for February 5, 2021r_20210205 <- bm_raster(roi_sf = roi_sf, |
I think no one is checking this page. Is there anyone who can help? Why does bm_raster create a null data set? |
@firatgundem Sorry for the delay here! Does the install.packages("devtools") Sometimes there's issues as the NASA LAADs archive is down which will cause https://ladsweb.modaps.eosdis.nasa.gov/archive/allData/5000/VNP46A4/2012/001/ Another issues could be the bearer token expired, so could be worth trying to regenerate that. |
Ah thanks for this! 1/ Could be worth making sure all the packages it depends on are up to date? readr, 2/ Are you on a mac or pc? |
I use pc and my packages are up-to-date. This is the latest error that I got: black_marble_data = bm_raster(roi_sf = shapefile, # this specifies the region of interest
Processing 1 nighttime light tiles 504 Gateway Time-outnginx Error in downloading data; bearer token likely invalid. Try regenerating the bearer token; please see this link for instructions to obtain a bearer token: https://github.com/worldbank/blackmarbler?tab=readme-ov-file#bearer-token-
It is also interesting to see these. Although it says the bearer token is likely invalid, I have just renewed it. How can it be invalid? |
I'm having the same problem too, I'll try to debug the code now. |
Yeah, the problem with me was the bearer key. It changed, Although I did not request the change. |
Here's a function that will stop that being an issue. It fetches an existing token or creates a new one if none exist:
|
@simon-smart88 Thanks for writing that function. Would love to add to the package + note in the documentation if OK with you. If you're willing to do a pull request that adds the function in here that'd be great - or I'm happy to just add myself if you prefer. Then I can test as well, add that to the documentation, then send the update to CRAN. (I may also add an option in the bm_raster/bm_extract functions for a user to either include (1) bearer or (2) username/password). |
Yes sure I will do - I think it probably needs a few tweaks to be robust to all eventualities though so will work on that and submit a PR. |
Amazing, thanks @simon-smart88! |
This has been the case for a month or so now. I've updated to the dev version but the problem persists. It seems unrelated to the
sf
object that I pass.Produces:
The text was updated successfully, but these errors were encountered: