{ "cells": [ { "cell_type": "markdown", "id": "0", "metadata": {}, "source": [ "\"Open\n", "\n", "Uncomment the following line to install [geemap](https://geemap.org) if needed." ] }, { "cell_type": "code", "execution_count": null, "id": "1", "metadata": {}, "outputs": [], "source": [ "# !pip install geemap" ] }, { "cell_type": "code", "execution_count": null, "id": "2", "metadata": {}, "outputs": [], "source": [ "import ee\n", "import geemap\n", "import geemap.colormaps as cm" ] }, { "cell_type": "code", "execution_count": null, "id": "3", "metadata": {}, "outputs": [], "source": [ "# geemap.update_package()" ] }, { "cell_type": "code", "execution_count": null, "id": "4", "metadata": {}, "outputs": [], "source": [ "cm.palettes.dem" ] }, { "cell_type": "code", "execution_count": null, "id": "5", "metadata": {}, "outputs": [], "source": [ "cm.palettes.ndvi" ] }, { "cell_type": "code", "execution_count": null, "id": "6", "metadata": {}, "outputs": [], "source": [ "cm.palettes.ndwi" ] }, { "cell_type": "code", "execution_count": null, "id": "7", "metadata": {}, "outputs": [], "source": [ "cm.get_palette(\"terrain\", n_class=8)" ] }, { "cell_type": "code", "execution_count": null, "id": "8", "metadata": {}, "outputs": [], "source": [ "cm.plot_colormap(\"terrain\", width=8.0, height=0.4, orientation=\"horizontal\")" ] }, { "cell_type": "code", "execution_count": null, "id": "9", "metadata": {}, "outputs": [], "source": [ "Map = geemap.Map()\n", "\n", "palette = cm.palettes.dem\n", "# palette = cm.palettes.terrain\n", "\n", "dem = ee.Image(\"USGS/SRTMGL1_003\")\n", "vis_params = {\"min\": 0, \"max\": 4000, \"palette\": palette}\n", "\n", "Map.addLayer(dem, vis_params, \"SRTM DEM\")\n", "Map.add_colorbar(vis_params, label=\"Elevation (m)\", layer_name=\"SRTM DEM\", font_size=9)\n", "Map" ] }, { "cell_type": "code", "execution_count": null, "id": "10", "metadata": {}, "outputs": [], "source": [ "Map.add_colorbar(\n", " vis_params, label=\"Elevation (m)\", orientation=\"vertical\", layer_name=\"SRTM DEM\"\n", ")" ] }, { "cell_type": "code", "execution_count": null, "id": "11", "metadata": {}, "outputs": [], "source": [ "Map.add_colorbar(\n", " vis_params,\n", " label=\"Elevation (m)\",\n", " orientation=\"vertical\",\n", " layer_name=\"SRTM DEM\",\n", " transparent_bg=True,\n", ")" ] }, { "cell_type": "code", "execution_count": null, "id": "12", "metadata": {}, "outputs": [], "source": [ "Map.add_colorbar(\n", " vis_params,\n", " discrete=True,\n", " label=\"Elevation (m)\",\n", " orientation=\"vertical\",\n", " layer_name=\"SRTM DEM\",\n", ")" ] }, { "cell_type": "code", "execution_count": null, "id": "13", "metadata": {}, "outputs": [], "source": [ "# cm.list_colormaps()" ] }, { "cell_type": "code", "execution_count": null, "id": "14", "metadata": {}, "outputs": [], "source": [ "cm.plot_colormaps(width=12, height=0.4)" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" } }, "nbformat": 4, "nbformat_minor": 5 }