Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

https://github.com/r-earthengine/rgeeExtra

Extension for rgee
https://github.com/r-earthengine/rgeeExtra

rgee

Last synced: 3 months ago
JSON representation

Extension for rgee

Lists

README

        












rgeeExtra: An Extension for rgee


Simplifies the interaction with the GEE API making it more R-like. Popular third-party GEE algorithms are made available to R users



Open in Colab


Project Status: Active – The project has reached a stable, usable state and is being actively developed.




License


lifecycle


status


CRAN status


DOI





Installation
How does it work?
Example
Code of conduct
Contributing
Citation
Credits

## **Why rgeeExtra is needed?** 🤔

The goal of rgeeExtra is to enhance the user experience ⚡ of Google Earth Engine (GEE) 🌐 for R enthusiasts by simplifying its syntax. While GEE's primary language is JavaScript, which diverges from R's structure, rgeeExtra serves as a bridge 🌉, offering R users a suite of tools and functions to navigate GEE's complexity with ease. This extension elevates R interaction with GEE through high-level 📈 abstractions and tailored functions, all adapted from the JavaScript API.

Python (ee)
R (rgee)
R (rgee + rgeeExtra)


``` python
import ee
ee.Initialize()
db = 'CGIAR/SRTM90_V4'
image = ee.Image(db)
image.bandNames().getInfo()
#> [u'elevation']
```

``` r
library(rgee)
ee_Initialize()
db <- 'CGIAR/SRTM90_V4'
image <- ee$Image(db)
image$bandNames()$getInfo()
#> [1] "elevation"
```

``` r
library(rgee)
library(rgeeExtra)

ee_Initialize()
extra_Initialize()

image <- ee$Image$Dataset$CGIAR_SRTM90_V4
names(image)
#> [1] "elevation"
```

## **Installation** 🚀

You can install rgeeExtra from [GitHub](https://github.com/r-earthengine/rgeeExtra) with:

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

For additional details on connecting GEE and R, refer to the documentation provided [here](https://github.com/r-spatial/rgee#installation). To set up an account, click [here](https://earthengine.google.com/signup/).

## **How does it work?️** 🛠

The rgeeExtra extends the following Earth Engine classes:

- [ee\$Geometry](https://developers.google.com/earth-engine/guides/geometries)
- [ee\$Feature](https://developers.google.com/earth-engine/guides/features)
- [ee\$FeatureCollection](https://developers.google.com/earth-engine/guides/feature_collections)
- [ee\$Image](https://developers.google.com/earth-engine/guides/image_overview)
- [ee\$ImageCollection](https://developers.google.com/earth-engine/guides/ic_creating)

rgeeExtra develops and maintains new methods and constructors that extend the most popular GEE classes (e.g., `ee$Feature$Extra\_...`). All third-party methods implemented by rgeeExtra start with `Extra\_.` To learn more about all the functionalities that rgeeExtra offers, please refer to the article [Features](https://r-earthengine.com/rgeeExtra/articles/) for additional information.

## **Example** 💡

Look at this simple example to estimate the NDVI from a Landsat-8 Surface Reflectance image.

With [**rgee**](https://github.com/r-spatial/rgee):

``` r
# Load 'rgee' and initialize GEE
library(rgee)
ee_Initialize()

# Compute squared NDVI from Landsat 8 image
img <- ee$Image("LANDSAT/LC08/C02/T1_L2/LC08_007067_20140822")$
normalizedDifference(c("SR_B5", "SR_B4"))$
pow(2)

# Visualize squared NDVI on map
Map$centerObject(img)
Map$addLayer(
eeObject = img,
visParams = list(
min = 0,
max = 0.2,
palette = c("brown", "yellow", "green")
),
name = "Squared NDVI")
```

With [**rgeeExtra**](https://github.com/r-earthengine/rgeeExtra):

``` r
# Load 'rgee' and initialize GEE
library(rgee)
library(rgeeExtra)

ee_Initialize()
extra_Initialize()

# Compute squared NDVI from Landsat 8 image
img <- ee$Image("LANDSAT/LC08/C02/T1_L2/LC08_007067_20140822")
ndvi <- ((img[["SR_B5"]] - img[["SR_B4"]]) / (img[["SR_B5"]] + img[["SR_B4"]])) ** 2
names(ndvi) <- "NDVI"

# Visualize squared NDVI on map
Map$centerObject(ndvi)
Map$addLayer(
eeObject = ndvi,
visParams = list(
min = 0,
max = 0.2,
palette = c("brown", "yellow", "green")
),
name = "Squared NDVI"
)
```

## **Code of Conduct** 📜

Please note that the `rgeeExtra` project is released with a [Contributor Code of Conduct](CODE_OF_CONDUCT.md). By contributing to this project, you agree to abide by its terms.

## **Contributing Guide** 🤝

👍 Thanks for taking the time to contribute! 🎉👍 Please review our [Contributing Guide](CONTRIBUTING.md).

## **Share the love** ❤️

Think **rgeeExtra** is useful? Let others discover it, by telling them in person via Twitter or a blog post.

Using **rgeeExtra** for a paper you are writing? Consider citing it

``` r
citation("rgeeExtra")
To cite rgee in publications use:

C Aybar, Q Wu, L Bautista, R Yali and A Barja (2020) rgee: An R
package for interacting with Google Earth Engine Journal of Open
Source Software URL https://github.com/r-spatial/rgee/.

A BibTeX entry for LaTeX users is

@Article{,
title = {rgee: An R package for interacting with Google Earth Engine},
author = {Cesar Aybar and Quisheng Wu and Lesly Bautista and Roy Yali and Antony Barja},
journal = {Journal of Open Source Software},
year = {2020},
}
```

## **Credits** 👏

We would like to mention the following third-party R/Python packages for contributing indirectly to the improvement of rgeeExtra:

- [**eemont - David Montero Loaiza**](https://github.com/davemlz/eemont)