{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "\"Open" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Uncomment the following line to install [geemap](https://geemap.org) if needed." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# !pip install geemap" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import ee\n", "import geemap" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "geemap.show_youtube('k477ksjkaXw')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Create an interactive map" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "Map = geemap.Map(center=(40, -100), zoom=4)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Add Earth Engine Python script" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# Add Earth Engine dataset\n", "dem = ee.Image('USGS/SRTMGL1_003')\n", "landcover = ee.Image(\"ESA/GLOBCOVER_L4_200901_200912_V2_3\").select('landcover')\n", "landsat7 = ee.Image('LANDSAT/LE7_TOA_5YEAR/1999_2003').select(\n", " ['B1', 'B2', 'B3', 'B4', 'B5', 'B7']\n", ")\n", "states = ee.FeatureCollection(\"TIGER/2018/States\")\n", "\n", "# Set visualization parameters.\n", "vis_params = {\n", " 'min': 0,\n", " 'max': 4000,\n", " 'palette': ['006633', 'E5FFCC', '662A00', 'D8D8D8', 'F5F5F5'],\n", "}\n", "\n", "# Add Earth Engine layers to Map\n", "Map.addLayer(dem, vis_params, 'SRTM DEM', True, 0.5)\n", "Map.addLayer(landcover, {}, 'Land cover')\n", "Map.addLayer(\n", " landsat7,\n", " {'bands': ['B4', 'B3', 'B2'], 'min': 20, 'max': 200, 'gamma': 2.0},\n", " 'Landsat 7',\n", ")\n", "Map.addLayer(states, {}, \"US States\")\n", "\n", "Map" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" } }, "nbformat": 4, "nbformat_minor": 5 }