items_sign_bdc: Signature in hrefs provided by the STAC from the Brazil Data...

View source: R/signatures.R

items_sign_bdcR Documentation

Signature in hrefs provided by the STAC from the Brazil Data Cube project.

Description

These functions provide support to access assets from Brazil Data Cube.

  • items_sign_bdc(): [Experimental] 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 by items_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_KEYor use acess_token parameter.

Usage

items_sign_bdc(items, access_token = NULL, ...)

sign_bdc(access_token = NULL, ...)

Arguments

items

a doc_item or doc_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 the httr 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 to items_sign().

Examples

## Not run: 
 # 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>"))

## End(Not run)


rstac documentation built on Sept. 11, 2024, 7:03 p.m.