Learn R Programming

sits (version 0.10.0)

sits_cube.s2_l2a_aws_cube: Defines a data cube for a Sentinel-2 L2A AWS cube

Description

Defines a cube to retrieve data from the Sentinel-2 L2A data available in AWS. Users need to be an AWS user and provide her access key and secret key. These keys may be passed as environment variables. The AWS bands in 10m resolution are "B02", "B03", "B04", and "B08". The 20m bands are "B02", "B03", "B04", "B05", "B06", "BO7", "B08", "B8A", "B11", and "B12". All 12 bands are available at 60m resolution.

Usage

# S3 method for s2_l2a_aws_cube
sits_cube(
  type = "S2_L2A_AWS",
  ...,
  name = NULL,
  bands = NULL,
  tiles = NULL,
  start_date = NULL,
  end_date = NULL,
  s2_aws_resolution = NULL
)

Arguments

type

type of cube

...

other parameters to be passed for specific types

name

output data cube.

bands

vector of bands.

tiles

vector of tiles

start_date

starting date of the cube

end_date

ending date of the cube

s2_aws_resolution

resolution of S2 images ("10m", "20m" or "60m")

Value

data cube

Examples

Run this code
# NOT RUN {
# this example requires access to an external service, so should not be run
# by CRAN

# s3://sentinel-cogs/sentinel-s2-l2a-cogs/2017/S2A_35MNR_20171025_0_L2A/

# Provide your AWS credentials here
# Sys.setenv(
# "AWS_ACCESS_KEY_ID"     = <your_access_key>,
# "AWS_SECRET_ACCESS_KEY" = <your_secret_access_key>,
# "AWS_DEFAULT_REGION"    = <your AWS region>,
# "AWS_ENDPOINT" = "sentinel-s2-l2a.s3.amazonaws.com",
# "AWS_REQUEST_PAYER"     = "requester"
# )

s2_cube <- sits_cube(
    type = "S2_L2A_AWS",
    name = "T20LKP_2018_2019",
    satellite = "SENTINEL-2",
    sensor = "MSI",
    tiles = "20LKP",
    s2_aws_resolution = "20m",
    start_date = as.Date("2018-07-18"),
    end_date = as.Date("2018-07-23")
)
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab