| earthdata_token | R Documentation |
Returns the bearer token used for VIIRS/Black Marble downloads from NASA LAADS DAAC.
earthdata_token(token = NULL)
token |
Character string. If |
Getting a token (web):
Create an account at https://urs.earthdata.nasa.gov
Accept the MERIS and Sentinel EULAs under Profile > EULAs
Go to Profile > Generate Token, click "Generate Token", then "Show Token"
Copy the token (starts with EDL-) and store it
Supplying the token:
Set EARTHDATA_TOKEN environment variable (recommended: add to ~/.Renviron)
Or pass it directly as the token argument
Or set EARTHDATA_USERNAME + EARTHDATA_PASSWORD to fetch it automatically
Bhuvan NTL functions (bhuvan_stats(), bhuvan_raster()) do not require
any authentication.
The access token string, invisibly.
## Not run:
# Option 1: token from Profile > Generate Token on urs.earthdata.nasa.gov
Sys.setenv(EARTHDATA_TOKEN = "EDL-xxxxxxxxxxxxxxxxxxxx")
token <- earthdata_token()
# Option 2: username + password (fetches token automatically)
Sys.setenv(EARTHDATA_USERNAME = "myuser", EARTHDATA_PASSWORD = "mypass")
token <- earthdata_token()
# Option 3: pass directly
token <- earthdata_token("EDL-xxxxxxxxxxxxxxxxxxxx")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.