Signature in hrefs provided by the STAC from the Brazil Data Cube project.
Source:R/signatures.R
items_sign_bdc.Rd
These functions provide support to access assets from Brazil Data Cube.
items_sign_bdc()
: A simplified function to sign assets' URL from Brazil Data Cube to be able to access the data.sign_bdc()
: Creates a signing function to be used byitems_sign()
. This function sign all the assets' URL.
To sign the hrefs with your token you need to store it in an
environment variable in BDC_ACCESS_KEY
or use acess_token
parameter.
Arguments
- items
a
doc_item
ordoc_items
object representing the result of/stac/search
,/collections/{collectionId}/items
or/collections/{collectionId}/items/{itemId}
endpoints.- access_token
a
character
with the access token parameter to access Brazil Data Cube assets.- ...
additional parameters can be supplied to the
GET
function of thehttr
package.
Value
a function
that signs each item assets.
items_sign_bdc()
: items with signed assets URLs.sign_bdc()
: a function to to be passed toitems_sign()
.
Examples
if (FALSE) { # \dontrun{
# doc_items object
stac_obj <- stac("https://brazildatacube.dpi.inpe.br/stac/") %>%
stac_search(collections = "CB4-16D-2",
datetime = "2019-06-01/2019-08-01") %>%
stac_search() %>%
get_request()
# the new way to authenticate:
stac_obj <- stac_obj %>%
items_sign_bdc("<your-access-token>")
# this is the old way of authentication (still works):
# stac_obj %>%
# items_sign(sign_fn = sign_bdc(access_token = "<your-access-token>"))
} # }