DownloadSentinel2: Download Sentinel 2 dataset from google cloud.

Description Usage Arguments Details Examples

View source: R/DownloadSentinel2.R

Description

This function requires Google Cloud Storage SDK, you can download and install this SDK from google cloud website: https://cloud.google.com/sdk/install and make sure the system PATH is set so you can use 'gsutil' tool directly in command line.

Usage

1
DownloadSentinel2(tilename, folder, L2Flag = FALSE, regExp = NULL)

Arguments

tilename

what tile do you want to download

folder

local folder used to store downloaded files

L2Flag

indicate to download L2A product or L1C product (default)

regExp

regular expression, (default is NULL) with which you can specify which files you want. Be really careful to use this. For example, regExp <- "S2\D_MSIL\d\D_201([6]|[8][0][0-9]).*.SAFE/$" means you want data from 2016 and before 2018 before October.

Details

And just to notice. Most L2A data is only available after 2018, if you want to use L2A before 2018, you need to download L1C data and do the atmophere correction using sen2cor yourself. You can search if there is L2A data available in your study area using website: https://scihub.copernicus.eu/dhus/#/home , but that website doesn't support batch downloading, and download data from there is much more slower than from google cloud.

Once it started, press ctrl+c in the command line can stop it.

If there's any bug, please let me know.

Author: Jacory

Examples

1
DownloadSentinel2("17SNA", "D:/", L2Flag = TRUE, rexExp = "S2\\D_MSIL\\d\\D_201([6]|[8][0][0-9]).*.SAFE/$")

mcgregorian1/cgaR documentation built on Dec. 8, 2019, 1:45 p.m.