Skip to content

Instantly share code, notes, and snippets.

@jdbcode
Last active May 12, 2021 16:40
Show Gist options
  • Save jdbcode/cd911f53c14483ce37386de04c0cec56 to your computer and use it in GitHub Desktop.
Save jdbcode/cd911f53c14483ce37386de04c0cec56 to your computer and use it in GitHub Desktop.
[Medium] RStudio Cloud and rgee eemont NDWI
library(rgee)
library(RColorBrewer)
library(reticulate)
ee_Initialize()
eemont <- reticulate::import("eemont")
point <- ee$Geometry$Point(c(-76.9, 7.2))
L8 <- (ee$ImageCollection('LANDSAT/LC08/C01/T1_SR')
$filterBounds(point)
$filterDate("2020-01-01", "2021-01-01"))
L8Median <- L8$maskClouds()$scale()$index("NDWI")$median()
visParamsNDWI <- list(
min = -1,
max = 1,
bands = "NDWI",
palette = brewer.pal(7, "YlGnBu")
)
Map$centerObject(point, 8)
Map$addLayer(L8Median, visParamsNDWI, "L8 NDWI")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment