Skip to content

Instantly share code, notes, and snippets.

View csaybar's full-sized avatar
🇵🇪

Cesar Aybar csaybar

🇵🇪
View GitHub Profile
@csaybar
csaybar / SamplePredictorLayers.R
Created August 11, 2021 14:43
SamplePredictorLayers.R
#' Script to sample multiple layers by years 1990 - 2011 using a point dataset
#' @description Layers: Landsat spectral values; NDVI; NDMI; NBR; Elevation, Slope, Aspect.
#'
#' PARAMETERS
#'
#'
library(rgee)
ee_Initialize()
USUptsNew <- ee$FeatureCollection("users/dougramsey/ForCaMF/PointData/USU_RandomPoints_NEW")
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@csaybar
csaybar / medium_rstudio_cloud_rgee_ndvi.R
Created May 21, 2021 23:47 — forked from jdbcode/medium_rstudio_cloud_rgee_ndvi.R
[Medium] RStudio Cloud and rgee NDVI animation
library(rgee)
library(sf)
library(magick)
ee_Initialize()
mask <- system.file("shp/arequipa.shp", package = "rgee") %>%
st_read(quiet = TRUE) %>%
sf_as_ee()
library(rgee)
ee_Initialize()
download_point <- function(point_name, output = ".") {
# Create folder
point_dir <- sprintf("%s/%s", output, point_name)
dir.create(point_dir, showWarnings = FALSE)
@csaybar
csaybar / rgee_demos.R
Created March 8, 2021 22:23
rgee v.1.0.9
# Spatial R packages ------------------------------------------------------
library(cptcity)
library(mapview)
library(leaflet)
library(rgee)
library(sf)
# Initialize Google Earth Engine (Just One time)
ee_Initialize()
@csaybar
csaybar / stack_q.R
Last active January 23, 2021 22:03
library(dplyr)
library(rgee)
library(sf)
library(googledrive)
library(googleCloudStorageR)
library(lwgeom)
library(reticulate)
library(jsonlite)
@csaybar
csaybar / img.R
Created January 5, 2021 17:44
RGEE_EXAMPLES_IMAGES
Save here your images
library(rgee)
# -------------------------------------------------------------------------
# 1. Load Earth Engine ----------------------------------------------------
# -------------------------------------------------------------------------
ee_Initialize(drive = TRUE)
# -------------------------------------------------------------------------
# 2. Auxiliary functions --------------------------------------------------
@csaybar
csaybar / deletesen2cube.py
Created December 10, 2020 10:58
delete_files
from typing import List
import datetime
import pathlib
import re
class Sen2CubeFiles:
def __init__(self, path: str):
self.path = path
self.__fake_path = path
self._files = self.search_iter(".")
@csaybar
csaybar / rgee.R
Created December 5, 2020 14:23
antony
## Travel time to school facilities as a marker of geographical ##
## accessibility across heterogeneous land cov ##
##' @GabrielCarrasco-Escobar, @EdgarManrique, @KellyTello-Lizarraga, ##
##' @J.JaimeMiranda,@AntonyBarja ##
##'-------------------------------------------------------------------##
# Requerements
library(tidyverse)
library(cptcity)
library(rgee)