{
"cells": [
{
"cell_type": "markdown",
"metadata": {
"id": "cceYxzyPHzW4"
},
"source": [
"**CURSO**: Sensores Remotos, Departamento de Geociencias y Medio Ambiente, Universidad Nacional de Colombia - sede Medellín
\n",
"**Profesor**: Edier Aristizábal (evaristizabalg@unal.edu.co)
\n",
"**Credits**: The content of this notebook is taken from several sources such as: [DM Heli](https://medium.com/@shiela.mms/visualising-remotely-sensed-data-from-google-earth-engine-in-python-c12fced85b72). Every effort has been made to trace copyright holders of the materials used in this book. The author apologies for any unintentional omissions and would be pleased to add an acknowledgment in future editions."
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "VqHkND01HzW9"
},
"source": [
"# Introducción Earth Engine Python API\n",
"Para utilizar el Earth Engine Python API se recomienda instalarlo a travez de Anaconda. Para este ejemplo vamos a crear un ambiente, en el cual instalaremos el API de GEE.\n",
"\n",
"Lo primero es dirigirse a la linea de comandos con la tecla Windows + R, o en start buscar por cmd. De click y se abrirá el command prompt. Si ya tiene instalado Anaconda, utilice el siguiente comando para activar el ambiente\n",
"\n",
">> Conda activate\n",
"\n",
"Este comando lo dirige al ambiente base. Para crear un ambiente llamado \"ee\" donde instalará GEE utilice el siguiente comando:\n",
"\n",
">> conda create --name ee\n",
"\n",
"En realidad puede darle el nombre al ambiente que prefiera. Para activar el ambiente creado utilice:\n",
"\n",
">> conda activate ee\n",
"\n",
"Ya le debe aparecer el command prompt pero en el ambiente ee. Para instalar el API de GEE en este ambiente utilice el comando:\n",
"\n",
">> conda install -c conda-forge earthengine-api\n",
"\n",
"Tambíen puede ser instalado *pip*\n",
"\n",
">>!pip install earthengine-api\n",
"\n",
"Este comando evalua los paquetes que requiere, a lo cual debe decirle que si para terminar con la instalación. Pero antes de estar listo para utlizar el API se deben obtener las credenciales de GEE. Para eso utilice el siguiente comando:\n",
"\n",
">>earthengine authenticate\n",
"\n",
"Esto lo lleva a una página donde debe seleccionar la cuenta de GEE y autorizar el uso, y obtendrá un código que debe copiar e introducir en el command prompt.\n",
"\n",
"LISTO, ya puede utilizar el API de GEE."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "Gqms62JOHzW_"
},
"outputs": [],
"source": [
"# Ya estamos listos para importar la libreria ee de GEE\n",
"import ee\n",
"import ee.mapclient"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {
"id": "89IHeCsurmvS"
},
"outputs": [
{
"data": {
"text/html": [
"
To authorize access needed by Earth Engine, open the following\n", " URL in a web browser and follow the instructions:
\n", " \n", "The authorization workflow will generate a code, which you should paste in the box below.
\n", " " ], "text/plain": [ "The Shuttle Radar Topography Mission (SRTM, see Farr\\net al. 2007)\\ndigital elevation data is an international research effort that\\nobtained digital elevation models on a near-global scale. This\\nSRTM V3 product (SRTM Plus) is provided by NASA JPL\\nat a resolution of 1 arc-second (approximately 30m).
This dataset has undergone a void-filling process using open-source data\\n(ASTER GDEM2, GMTED2010, and NED), as opposed to other versions that\\ncontain voids or have been void-filled with commercial sources.\\nFor more information on the different versions see the\\nSRTM Quick Guide.
Documentation:
Provider: NASA / USGS / JPL-Caltech
Bands
| Name | Description |
|---|---|
| elevation | Elevation |
Terms of Use
Unless otherwise noted, images and video on JPL public\\nweb sites (public sites ending with a jpl.nasa.gov address) may\\nbe used for any purpose without prior permission. For more information\\nand exceptions visit the JPL Image Use Policy site.
Suggested citation(s)
Farr, T.G., Rosen, P.A., Caro, E., Crippen, R., Duren, R., Hensley,\\nS., Kobrick, M., Paller, M., Rodriguez, E., Roth, L., Seal, D.,\\nShaffer, S., Shimada, J., Umland, J., Werner, M., Oskin, M., Burbank,\\nD., and Alsdorf, D.E., 2007, The shuttle radar topography mission:\\nReviews of Geophysics, v. 45, no. 2, RG2004, at\\nhttps://doi.org/10.1029/2005RG000183.
To authorize access needed by Earth Engine, open the following\n", " URL in a web browser and follow the instructions:
\n", " \n", "The authorization workflow will generate a code, which you\n", " should paste in the box below
\n", " " ], "text/plain": [ "