get.ecors | R Documentation |
Get data from Google Earth Engine for your study site and integrate with study polygons and sampling periods.
get.ecors( site = NULL, points = NULL, plots = NULL, id.column = 1, buffer.points = 1, buffer.plots = 0, projected = FALSE, custom.crs = NULL, collection, start, end, bands.eval = NULL, bands.vis = T, indices = c("NDVI", "EVI", "NBR"), resolution, eval.area = "site", pOK = 0.8, c.dist, clouds.sentinel = NULL, c.prob = NULL, cirrus.threshold = NULL, NIR.threshold = NULL, CDI.threshold = NULL, dmax.shadow = NULL, seasons = list(s1 = c(), s2 = c(), s3 = c(), s4 = c()), group.by = "month", composite = NULL, online.storage = "drive" )
site |
polygon of study site (sf object). |
points |
sampling points (sf object). |
plots |
sampling plots (sf object). |
id.column |
number of id.column in your points and/or plots objects (need to be the same for both). |
buffer.points |
radius (m) of buffer of points. Need to be > 0. |
buffer.plots |
radius (m) of buffer of plots. |
projected |
are the provided sf objects projected? (scale = m) |
custom.crs |
choose a crs code to project sf objects prior to buffer processing. |
collection |
Google Earth Engine collection name. |
start |
initial date (year-month-day). |
end |
final date (year-month-day). |
bands.eval |
bands needed for analysis (bands needed to calculate indices or visualization will be added automatically). |
bands.vis |
include bands for visualization? |
indices |
select indices to be produced. Available options are "NDVI", "EVI", "NBR". |
resolution |
select pixel size (m) for (most of) quality control procedures. This value will be passed to stats.ecors and download.ecors. |
eval.area |
choose evaluated area for quality control: site or samples. |
pOK |
minimum proportion of pixels aproved in quality control on the evaluated area to use a image. |
c.dist |
additional distance (m) around pre-identified clouds that will be disregarded in the mask (when clouds.sentinel="CDI", c.dist should be multiples of 100 m). Usefull to avoid false negative cloud detection in cloud edges. |
clouds.sentinel |
method for cloud detection in Sentinel-2 MSI. Options are the collection "default" (using built in Quality Analysis of these collections; several false negative pixels; not detect cloud shadows in TOA images), "CDI" (more time consuming) or NULL. |
c.prob |
set the cloud probability threshold value to exclude pixels in Sentinel-2 MSI imagens. It could remove additional pixels with clouds.sentinel="default" (not compatible with "CDI" method). |
cirrus.threshold |
set threshold value for method CDI (see Frantz et al. 2018 for details). |
NIR.threshold |
set threshold value for method CDI (see Frantz et al. 2018 for details). |
CDI.threshold |
set threshold value for method CDI (see Frantz et al. 2018 for details). |
dmax.shadow |
set the maximum distance that CDI Algorithm will search for clouds. Large values take a lot of processing time or may crash Google Earth Engine. Value in meters (in multiples of 100 m). |
seasons |
month allocation (numerical form) in up to four seasons. Use the list structure list(s1=c(), s2=c(), s3=c(), s4=c()) keeping the items you don't want to use empty. More information in the exemples section. |
group.by |
should data be grouped by "season" or "month"? This parameter influences how the data will be summarized in stats.ecors and (if selected) how the images will be composited. |
composite |
method for generating composite images in the collection Available options to argument composite: min, max, mean, median and NULL (disable composition). |
online.storage |
select online storage integration (mandatory for images download). Options are "drive" for Google Drive, "gcs" for Google Cloud Storage or NULL. |
Currently ecors supports the following remote sensing data collections:
Landsat 8
"LANDSAT/LC08/C02/T1_L2" Collection 2 - Surface Reflectance
"LANDSAT/LC08/C01/T1_SR" Collection 1 - Surface Reflectance
"LANDSAT/LC08/C01/T1_TOA" Collection 1 - Top of Atmosphere Reflectance
"LANDSAT/LC08/C01/T1" Collection 1 - Raw Images
Landsat 7
"LANDSAT/LE07/C02/T1_L2" Collection 2 - Surface Reflectance
"LANDSAT/LE07/C01/T1_TOA" Collection 1 - Top of Atmosphere Reflectance
"LANDSAT/LE07/C01/T1" Collection 1 - Raw Images
Sentinel-2 MSI (Multispectral Instrument)
"COPERNICUS/S2_SR" Surface Reflectance
"COPERNICUS/S2" Top of Atmosphere Reflectance
Global Precipitation Measurement (GPM)
"NASA/GPM_L3/IMERG_V06" Global Precipitation Measurement (GPM) v6 - every three hours
"NASA/GPM_L3/IMERG_MONTHLY_V06" Monthly Global Precipitation Measurement (GPM) v6
Object of the "ecors" class with metadata and pre-processed data to be used in the stats.ecors, plot.ecors or download.ecors functions. Aditional Google Earth Engine containers objects are exported to .GlobalEnv to be used in rgee functions and avoid errors (elapsed time limit):
colle (all images available in the period),
colle.filt (images approved in get.ecors quality control),
colle.mask (same as the previous one but with bad pixels masked),
colle.mask.compo (collection of compositions performed on the images of the previous collection).
Pixel quality control information:
Frantz, D., Hass, E., Uhl, A., Stoffels, J., & Hill, J. (2018). Improvement of the Fmask algorithm for Sentinel-2 images: Separating clouds from bright surfaces based on parallax effects. Remote sensing of environment, 215, 471-481.
https://www.usgs.gov/media/files/landsat-7-etm-collection-2-level-2-data-format-control-book
https://www.usgs.gov/media/files/landsat-4-5-tm-collection-2-level-2-data-format-control-book
https://www.usgs.gov/media/files/landsat-8-collection-1-land-surface-reflectance-code-product-guide
https://www.usgs.gov/media/files/landsat-4-7-collection-1-surface-reflectance-code-ledaps-product-guide
https://www.usgs.gov/core-science-systems/nli/landsat/landsat-collection-1-level-1-quality-assessment-band?qt-science_support_page_related_con=0#qt-science_support_page_related_con
FAL.IBGE.JBB<-sf::st_read(system.file("extdata/FAL.IBGE.JBB.gpkg", package="ecors")) test.points<-sf::st_read(system.file("extdata/Points_tests.gpkg", package="ecors")) test.plots<-sf::st_read(system.file("extdata/Plots_tests.gpkg", package="ecors")) #library(ecors) # Get data (projecting to UTM 32S zone to performe buffer operations) d2020<-get.ecors(site=FAL.IBGE.JBB, points=test.points, plots=test.plots, buffer.points=500, buffer.plots=500, eval.area="site", projected=F, custom.crs=32723, collection="LANDSAT/LC08/C02/T1_L2", start=c("2020-01-01"), end=c("2020-12-31"), bands.eval="SR_B3", bands.vis=T, indices=c("NDVI"), resolution=30, pOK=0.3, c.prob=NULL, c.dist=100, clouds.sentinel=NULL, cirrus.threshold=NULL, NIR.threshold=NULL, CDI.threshold=NULL, dmax.shadow=NULL, seasons=list(s1=c(11,12,1,2), s2=c(3,4), s3=c(5,6,7,8), s4=c(9,10)), group.by="month", composite="mean")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.