generated from just-the-docs/just-the-docs-template
-
Notifications
You must be signed in to change notification settings - Fork 2
Configuración GEE en r #18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Felipe-dlB
wants to merge
9
commits into
main
Choose a base branch
from
felipedLB-test
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
76beac2
Create test.md
fdobad dcc71a8
Update test.md
Felipe-dlB 72c344c
carpeta
5674356
dir images
c1bee8c
test qmd
Felipe-dlB c604f68
Merge branch 'felipedLB-test' of github.com:fire2a/docs into felipedL…
e8bb287
Update and rename conf_pkgs.qmd to conf_pkgs.md
Felipe-dlB 592c48e
prueba de imagenes con espacio
Felipe-dlB 01a9774
Update imagen sin {}
Felipe-dlB File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,103 @@ | ||
| --- | ||
| title: "Configuración R y GEE" | ||
| author: "Felipe de la Barra" | ||
| date: "2023-06-23" | ||
| output: html_document | ||
| --- | ||
|
|
||
| # Objetivo del script | ||
|
|
||
| El objetivo del presente documento es mostrar como configurar R y conectarlo con Google Earth Engine (GEE). Este script y pasos a seguir sólo deberá realizarlos la persona que mantendrá actualizados los mapas. | ||
|
|
||
| # Requisitos | ||
|
|
||
| ## Instalacion de R y RStudio | ||
|
|
||
| Para descargar ambos programas puede dirigirse a este [link](https://posit.co/download/rstudio-desktop/ "Descargar R y RStudio") y seguir las instrucciones. En el caso de R, seleccione el que corresponda con su sistema operativo. | ||
|
|
||
| [](https://cran.rstudio.com/) | ||
|
|
||
| Luego seleccione cualquiera de las opciones que muestran las flechas rojas y descargue la última versión de R (primera opción). Instale R en su computador. | ||
|
|
||
|  | ||
|
|
||
| Una vez instalado, descargue e instale RStudio. Una vez instalado, abra RStudio. | ||
|
|
||
| ## Creación de proyecto y carpetas requeridas. | ||
|
|
||
| Acá dejaré las instrucciones y quizás un código para crear las carpetas que se necesitan y las direcciones asociadas. Adicionalmente instrucciones o un código para revisar que estén todos los archivos necesarios. | ||
|
|
||
| ## Librerias requeridas | ||
|
|
||
| Para utilizar las herramientas de todo el proceso se necesitan los siguientes paquetes y sus dependencias: | ||
|
|
||
| - *tidyverse* | ||
|
|
||
| - *terra* | ||
|
|
||
| - *sf* | ||
|
|
||
| - *rgee* | ||
|
|
||
| - *rgeeExtra* | ||
|
|
||
| - *reticulate* | ||
|
|
||
| - *tmap* | ||
|
|
||
| - *furrr* | ||
|
|
||
| - *geojsonio* | ||
|
|
||
| - *leaflet.extras2* | ||
|
|
||
| - *readxl* | ||
|
|
||
| Para instalarlos existen dos opciones: | ||
|
|
||
| 1. Corra el siguiente código: | ||
|
|
||
| ```{r librerias, eval=FALSE, warning=FALSE} | ||
| #| message: false | ||
| install.packages(c('tidyverse', 'terra', 'sf', 'rgee', 'rgeeExtra', 'reticulate', 'tmap', 'furrr', 'geojsonio', 'leaflet.extras2', 'readxl')) | ||
| ``` | ||
|
|
||
| 2. Instale en forma manual los paquetes oprimiendo el botón *Install Packages*, dentro del botón *Tools* en la barra de herramientas superior: | ||
|
|
||
|  | ||
|
|
||
| # Conexión de R con GEE | ||
|
|
||
| GEE es una plataforma que combina un catálogo de varios petabytes de imágenes satelitales y conjuntos de datos geoespaciales con capacidades de análisis a escala planetaria ([más info](https://earthengine.google.com/ "Más información de GEE")). Para utilizar esta herramienta es necesario tener una cuenta de *Google Drive* asociada a la plataforma, es decir una cuenta de gmail. Adicionalmente debe tener instalado y configurado el paquete `rgee` ([más info](https://r-spatial.github.io/rgee/index.html "Info de rgee")). | ||
|
|
||
| Para crearse una cuenta en GEE, dirijase a este [link](https://earthengine.google.com "Crear cuenta en GEE."), oprima el boton *Get Started* y siga las instrucciones. | ||
|
|
||
| Por otro lado, para configurar el paquete `rgee`, debe correr la función `ee_check()`. Esta le preguntará si desea instalar python (si es que no lo tiene instalado/disponible), confirme, guarde la dirección de python que la consola de r le mostrará al final y cierre **R**. | ||
|
|
||
| ```{r instalando_GEE, eval=FALSE} | ||
| library(tidyverse) | ||
| library(rgee) | ||
| ee_check() | ||
| ``` | ||
|
|
||
| Luego deberá configurar la *API de Google Earth Engine* abriendo la consola de *Anaconda* instalada recientemente por el paquete `rgee` y activando el medioambiente de *r-reticulate* [(ayuda)](https://docs.conda.io/projects/conda/en/latest/user-guide/getting-started.html "Guía para activar medioambiente de python")*.* Luego deberá ingresar en la consola el siguiente código: `conda install -c conda-forge earthengine-api` y confirmar la descarga de los módulos necesarios. Una vez finalizado el proceso, cierre la consola. | ||
|
|
||
| Abra **R** y vuelva a cargar las librerías requeridas. Inmediatamente, en *"dirección de python"*, escriba la dirección de python que guardó anteriormente, corra el siguiente código y reinicie **R**. | ||
|
|
||
| ```{r instalando_GEE2, eval=FALSE} | ||
| library(tidyverse) | ||
| library(rgee) | ||
|
|
||
| rgee::ee_install_set_pyenv(py_path = "dirección de python") | ||
| ``` | ||
|
|
||
| Una vez configurado el paquete, siga las instrucciones que irán apareciendo a medida que corra el código a continuación. En este, debe reemplazar el nombre de usuario por la de su cuenta de GEE. | ||
|
|
||
| Adicionalmente, se recomiendo instalar el módulo de geemap para algunas funciones adicionales, corriendo la línea `py_install('geemap')` en el código de abajo para poder visualizar las capas a descargar y utilizar. | ||
|
|
||
| ```{r iniciando_GEE, eval=FALSE} | ||
| ee_check() | ||
| ee_Initialize(user = 'ee-usuario_GEE' ,drive = TRUE) | ||
| py_config() | ||
| py_install('geemap') | ||
| ``` |
Empty file.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. borrar |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| # markdown | ||
| que wna! | ||
| **hola** |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
al parecer este es el contenido principal, de la carpeta fuels.
no entiendo por qué se llama fuels, si al parecer esto es un tutorial para GEE en R Studio
falta info de cómo se relaciona esto con fire-res
el contenido principal de la carpeta por convención siempre se llama README.md