preprocS2
is a basic wrapper of the rstac
package.
It aims at downloading and preparing Sentinel-2 images for further processings using R packages such as
biodivMapR
for spectral diversity mapping,
prosail
for the computation of vegetation biophysical variables, and
spinr
for the computation of vegetation biophysical variables or spectral indices.
devtools::install_github('jbferet/preprocS2')
preprocS2
uses the STAC API endpoint provided by
MPC.
However, some products optionally required by preprocS2
are not provided by
this STAC API.
This is the case for raster data corresponding to the geometry of acquisition of
Sentinel-2 images.
These products are available from the STAC catalog provided by the Sentinel-hub Catalog API via Copernicus Dataspace.
To be able to download data from the Sentinel-hub STAC Catalog API via
Copernicus Dataspace,
create an account on the CDSE plateform, and activate the OAuth clients
following this link.
Then add your credentials to your ~/.Renviron
:
usethis::edit_r_environ()
and add the following lines before saving the ~/.Renviron
file.
PREPROCS2_CDSE_ID = "sh-XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
PREPROCS2_CDSE_SECRET = "XXXXXXXXXXXXXXXXXXXXXXXXXXXX"
Once the R session restarted, you can use all functionalities of preprocS2
.
A tutorial vignette is available here.
This research was supported by the Agence Nationale de la Recherche (ANR, France) through the young researchers project BioCop (ANR-17-CE32-0001)