Skip to content

Instantly share code, notes, and snippets.

View csaybar's full-sized avatar
🇵🇪

Cesar Aybar csaybar

🇵🇪
View GitHub Profile
@csaybar
csaybar / rgee_gif.R
Created August 21, 2020 14:23
gif creator
library(rgee)
ee_Initialize()
col <- ee$ImageCollection("JRC/GSW1_1/YearlyHistory")$map(function(img) {
year <- img$date()$get("year")
yearImg <- img$gte(2)$multiply(year)
despeckle <- yearImg$connectedPixelCount(15, TRUE)$eq(15)
yearImg$updateMask(despeckle)$selfMask()$set("year", year)
})
library(stars)
library(rgee)
# remotes::install_github("r-spatial/[email protected]")
ee_Initialize("csaybar", gcs = TRUE)
# Properties to attach to the uploaded raster
raster_properties <- list(prop2=1, prop1=2)
# -------------------------------------------------------------
@csaybar
csaybar / animation_01.R
Created August 9, 2020 10:22
rgee animations
library(rgee)
library(magick)
ee_Initialize()
col <- ee$ImageCollection("JRC/GSW1_1/YearlyHistory")$map(function(img) {
year <- img$date()$get("year")
yearImg <- img$gte(2)$multiply(year)
despeckle <- yearImg$connectedPixelCount(15, TRUE)$eq(15)
yearImg$updateMask(despeckle)$selfMask()$set("year", year)
@csaybar
csaybar / eehelp_addin_demo.R
Created August 8, 2020 08:30
ee_help addin demo
library(rgee)
help()
# Install rgee v.1.0.4
# devtools::install_github("r-spatial/rgee")
ee_Initialize()
s2_img_array <- ee$ImageCollection("COPERNICUS/S2") %>%
ee$ImageCollection$filterBounds(ee_random_point)%>% # Filter by space
ee$ImageCollection$filterDate("2016-01-01", "2016-12-31") %>% # Filter by time
ee$ImageCollection$mosaic() %>% # Create a ee$Image
@csaybar
csaybar / love.R
Created August 2, 2020 07:33
love
d
@csaybar
csaybar / points.geojson
Created July 27, 2020 17:31
rgee DEMOS
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@csaybar
csaybar / dinos.txt
Created July 23, 2020 19:00
files sequence model coursera 5
Aachenosaurus
Aardonyx
Abdallahsaurus
Abelisaurus
Abrictosaurus
Abrosaurus
Abydosaurus
Acanthopholis
Achelousaurus
Acheroraptor
@csaybar
csaybar / dinos.txt
Created July 23, 2020 19:00
files sequence model coursera 5
Aachenosaurus
Aardonyx
Abdallahsaurus
Abelisaurus
Abrictosaurus
Abrosaurus
Abydosaurus
Acanthopholis
Achelousaurus
Acheroraptor
@csaybar
csaybar / dinos.txt
Created July 23, 2020 19:00
files sequence model coursera 5
Aachenosaurus
Aardonyx
Abdallahsaurus
Abelisaurus
Abrictosaurus
Abrosaurus
Abydosaurus
Acanthopholis
Achelousaurus
Acheroraptor
@csaybar
csaybar / smap.R
Created June 17, 2020 23:21
smap L3 download
library(rgee)
library(sf)
ee_Initialize()
# Define study area
ee_arequipa <- system.file("shp/arequipa.shp", package="rgee") %>%
st_read() %>%
st_bbox() %>%
st_as_sfc() %>%