boettiger-lab / earthdatalogin

Making public access of public data a bit easier
https://boettiger-lab.github.io/earthdatalogin/
Other
23 stars 4 forks source link

Simple S3 example #1

Closed cboettig closed 1 year ago

cboettig commented 1 year ago

AWS S3 Tokens will only work from us-west-2-based compute

library(earthdatalogin)

# Set auth tokens -- assumes LPDAAC, specify your DAAC!
edl_s3_token()

# A random example COG from LPDAAC
url <- lpdacc_example_url()

# Reformat as an S3 URI
s3_addr <- edl_as_s3(url)

# peak at it
s3_addr

# here we go
terra::rast(s3_addr)