knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  eval = FALSE
)

rgeeExtra is an extension of the rgee package, enhancing the capabilities of Google Earth Engine (GEE) integration within the R environment. This guide provides a brief introduction to the key features and functionalities of the rgeeExtra package.

library(rgeeExtra)
library(rgee)

ee_Initialize()        # Initialize the Google Earth Engine API connection
extra_Initialize()     # Initialize the extended functionalities of rgeeExtra

The extra_Initialize() function ensures that the additional functionalities of rgeeExtra are ready to use. This step is vital to leverage the enhanced capabilities provided by the package.

Install

To install the rgeeExtra package, you can use the following:

remotes::install_github("r-earthengine/rgeeExtra")

Example

The focus here is to compute and visualize the Soil Adjusted Vegetation Index (SAVI) from the Sentinel-2 image and its logarithmic transformation.

savi <- ee$Image("COPERNICUS/S2_SR/20190310T105851_20190310T110327_T30TVK") %>% 
  ee$Image$preprocess()%>%
  ee$Image$spectralIndex("SAVI")

geoviz_1 <- list(palette = c('001fff', '00ffff', 'fbff00', 'ff0000'), min=0, max=0.3)
savi[savi > 0.3] <- 0

Map$addLayer(savi, geoviz, "SAVI") | Map$addLayer(log1p(savi)*2, geoviz, "log_SAVI")

This series of commands does the following:



r-earthengine/rgeeExtra documentation built on Dec. 7, 2023, 9:03 p.m.