Learn R Programming

rstac (version 0.9.1-5)

sign_planetary_computer: Signature in hrefs provided by the STAC from Microsoft's Planetary Computer.

Description

To perform the signing of the hrefs a request is sent to Planetary Computer servers and the returned content corresponds to the token that will be used in the href.

Usage

sign_planetary_computer(..., token_url = NULL)

Value

a function that signs each item assets.

Arguments

...

additional parameters can be supplied to the GET function of the httr package.

token_url

a character with the URL that generates the tokens in the Microsoft service. By default is used: "https://planetarycomputer.microsoft.com/api/sas/v1/token"

Examples

Run this code
if (FALSE) {
# STACItemCollection object
stac_obj <- stac("https://planetarycomputer.microsoft.com/api/stac/v1/") %>%
 stac_search(collections = "sentinel-2-l2a",
             bbox = c(-47.02148, -42.53906, -12.98314, -17.35063)) %>%
 get_request()

# signing each item href
stac_obj %>% items_sign(sign_fn = sign_planetary_computer())

}

Run the code above in your browser using DataLab