Google Earth Engine (Gorelick et al., 2017) is a cloud computing platform designed for planetary-scale environmental data analysis that only can be accessed via the Earth Engine code editor, third-party web apps, and the JavaScript and Python client libraries. rgee is a non-official client library for R that uses reticulate to wrap the Earth Engine Python API and provide R users with a familiar interface, rapid development features, and flexibility to analyze data using open-source, R third-party packages.

Details

The package implements and supports:

  • Earth Engine Module

  • Install or set all rgee dependencies

  • Check non-R dependencies

  • Clean non-R dependencies

  • Session management

  • Transform an R Date to an EE Date or vice versa

  • Create Interactive visualization Maps

  • Image download

  • Vector download

  • Generic download

  • Assets management

  • Upload raster

  • Upload vector

  • Upload generic

  • Extract values

  • Helper functions

  • Utils functions

I. Earth Engine Module

Interface to main Earth Engine module. Provides access to top level classes and functions as well as sub-modules (e.g. ee$Image, ee$FeatureCollection$first, etc.).

——————————————————————————————————————————
eeMain Earth Engine module.
——————————————————————————————————————————

II. Install or set non-R rgee dependencies

——————————————————————————————————————————
ee_installCreate an isolated Python virtual environment with all rgee dependencies.
ee_install_set_pyenvConfigure which version of Python to use with rgee.
ee_install_upgradeUpgrade the Earth Engine Python API.
——————————————————————————————————————————

III. Check non-R dependencies

——————————————————————————————————————————
ee_checkCheck all non-R dependencies.
ee_check_pythonCheck Python environment.
ee_check_credentialsCheck Google credentials.
ee_check_python_packagesCheck Python packages: earthengine-api and numpy.
——————————————————————————————————————————

IV. Clean container, credentials, or rgee system variables

——————————————————————————————————————————
ee_clean_containerDelete files from either a Folder or a Bucket.
ee_clean_pyenvRemove rgee system variables from .Renviron.
——————————————————————————————————————————

V. Session management

——————————————————————————————————————————
ee_InitializeAuthenticate and Initialize Earth Engine.
ee_versionEarth Engine API version.
ee_user_infoDisplay the credentials and general info of the initialized user.
ee_usersDisplay the credentials of all users as a table.
ee_get_assethomeGet the Asset home name.
ee_get_earthengine_pathGet the path where the credentials are stored.
——————————————————————————————————————————

VII. Transform an R Date to an EE Date or vice versa

——————————————————————————————————————————
eedate_to_rdatePass an Earth Engine date object to R.
rdate_to_eedatePass an R date object to Earth Engine.
ee_get_date_imgGet the date of a EE Image.
ee_get_date_icGet the date of a EE ImageCollection.
——————————————————————————————————————————

VIII. Visualization Map

——————————————————————————————————————————
MapR6 object (Map) to display Earth Engine (EE) spatial objects.
R6MapR6 class to display Earth Engine (EE) spatial objects.
——————————————————————————————————————————

IX. Image download

——————————————————————————————————————————
ee_as_rasterConvert an Earth Engine (EE) image in a raster object.
ee_as_starsConvert an Earth Engine (EE) image in a stars object.
ee_as_thumbnailCreate an R spatial gridded object from an EE thumbnail image.
ee_image_to_assetCreates a task to export an EE Image to their EE Assets.
ee_image_to_driveCreates a task to export an EE Image to Drive.
ee_image_to_gcsCreates a task to export an EE Image to Google Cloud Storage.
ee_image_infoApproximate size of an EE Image object.
ee_imagecollection_to_localSave an EE ImageCollection in their local system.
——————————————————————————————————————————

X. Vector download

——————————————————————————————————————————
ee_as_sfConvert an Earth Engine table in an sf object.
ee_table_to_assetCreates a task to export a FeatureCollection to an EE table asset.
ee_table_to_driveCreates a task to export a FeatureCollection to Google Drive.
ee_table_to_gcsCreates a task to export a FeatureCollection to Google Cloud Storage.
——————————————————————————————————————————

XI. Generic download

——————————————————————————————————————————
ee_drive_to_localMove results from Google Drive to a local directory.
ee_gcs_to_localMove results from Google Cloud Storage to a local directory.
——————————————————————————————————————————

XII. Assets management

——————————————————————————————————————————
ee_manage-toolsInterface to manage the Earth Engine Asset.
——————————————————————————————————————————

XIII. Upload raster

——————————————————————————————————————————
stars_as_eeConvert a stars or stars-proxy object into an EE Image object.
raster_as_eeConvert a Raster* object into an EE Image object.
gcs_to_ee_imageMove a GeoTIFF image from GCS to their EE assets.
——————————————————————————————————————————

XIV. Upload vector

——————————————————————————————————————————
gcs_to_ee_tableMove a zipped shapefile from GCS to their EE Assets.
sf_as_eeConvert an sf object to an EE object.
——————————————————————————————————————————

XV. Upload generic

——————————————————————————————————————————
local_to_gcsUpload local files to Google Cloud Storage.
——————————————————————————————————————————

XVI. Extract values

——————————————————————————————————————————
ee_extractExtract values from EE Images or ImageCollections objects.
——————————————————————————————————————————

XVII. Helper functions

——————————————————————————————————————————
ee_helpDocumentation for Earth Engine Objects.
ee_printPrint and return metadata about Spatial Earth Engine Objects.
ee_monitoringMonitoring Earth Engine task progress.
printPrint Earth Engine objects.
——————————————————————————————————————————

XVIII. Utils functions

——————————————————————————————————————————
ee_utils_py_to_rConvert between Python and R objects.
ee_utils_pyfuncWrap an R function in a Python function with the same signature.
ee_utils_shp_to_zipCreate a zip file from an sf object.
ee_utils_create_jsonConvert a R list into a JSON file.
ee_utils_create_manifest_imageCreate a manifest to upload an image.
ee_utils_create_manifest_tableCreate a manifest to upload a table.
ee_utils_get_crsConvert EPSG, ESRI or SR-ORG code into a OGC WKT.
ee_utils_future_valueThe value of a future or the values of all elements in a container.
ee_utils_dataset_displaySearch into the Earth Engine Data Catalog.
——————————————————————————————————————————

Acknowledgments

We want to offer a special thanks to Justin Braaten for his wise and helpful comments in the whole development of rgee. As well, we would like to mention the following third-party R/Python packages for contributing indirectly to the improvement of rgee:

  • gee_asset_manager - Lukasz Tracewski

  • geeup - Samapriya Roy

  • geeadd - Samapriya Roy

  • eemont - David Montero Loaiza

  • cartoee - Kel Markert

  • geetools - Rodrigo E. Principe

  • landsat-extract-gee - Loïc Dutrieux

  • earthEngineGrabR - JesJehle

  • sf - Edzer Pebesma

  • stars - Edzer Pebesma

  • gdalcubes - Marius Appel

Author

Maintainer: Cesar Aybar csaybar@gmail.com (ORCID)

Other contributors: