Introduction

This repository is a collection of 250+ R script examples. The majority of theses examples were adapted from the repos qgis-earthengine-examples and earthengine-py-notebooks. Would you like to contribute with your own examples? Please open an issue here attaching your reproducible script. I will upload as soon as possible to the website!

What is rgee?

rgee is a binding package for calling Google Earth Engine API from within R. Additionally, several functions have been implemented to make simple the connection with the R spatial ecosystem.

Google Earth Engine is a cloud-based platform that allows users to have an easy access to a petabyte-scale archive of remote sensing data and run geospatial analysis on Google’s infrastructure. Currently, Google offers support only for Python and JavaScript. rgee will fill the gap starting to provide support to R!. Below you will find the comparison between the syntax of rgee and the two Google-supported client libraries.

rgee installation

Install the rgee package from GitHub is quite simple, you just have to run in your R console as follows:

remotes::install_github("r-spatial/rgee")

rgee depends on sf. Therefore, is necessary to install its external libraries, follow the installation steps specified here.

Docker image

docker pull csaybar/rgee
docker run -d -p 8787:8787 -e USER=rgee -e PASSWORD=rgee --name rgee-dev csaybar/rgee

After that, in your preferred browser, run:

127.0.0.1:8787

setup

Prior to using rgee you will need to install a Python version higher than 3.5 in their system. rgee counts with an installation function (ee_install) which helps to setup rgee correctly:

library(rgee)

## It is necessary just once
ee_install()

# Initialize Earth Engine!
ee_Initialize()

Additionally, you might use the functions below for checking the status of rgee dependencies and delete credentials.

ee_check() # Check non-R dependencies
ee_clean_credentials() # Remove credentials of a specific user
ee_clean_pyenv() # Remove reticulate system variables

Also, consider looking at the setup section for more information on customizing your Python installation.

Examples

The Table of Contents below mimics the structure of the Google Earth Engine API Documentation. I strongly encourage you to check out the API Documentation if you need an in-depth explanation of each R example.

Get Started

Machine Learning

Image

ImageCollection

Geometry, Feature, FeatureCollection

Reducer

Join

Array

Specialized Algorithms

Asset Management

How Earth Engine Works

Filter

Visualization

Datasets

Tutorials

RGEE examples