{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "[![image](https://colab.research.google.com/assets/colab-badge.svg)](https://githubtocolab.com/gee-community/geemap/blob/master/examples/notebooks/119_plot_raster.ipynb)\n", "[![image](https://mybinder.org/badge_logo.svg)](https://gishub.org/geemap-binder)\n", "\n", "Uncomment the following line to install [geemap](https://geemap.org) if needed." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# !pip install -U geemap" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import os\n", "import geemap" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Download a sample dataset." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "url = 'https://github.com/giswqs/data/raw/main/raster/srtm90.tif'" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "image = 'srtm90.tif'\n", "if not os.path.exists(image):\n", " geemap.download_file(url, image)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Plot the raster image in 2D." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "geemap.plot_raster(image, cmap='terrain', figsize=(15, 10))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "![](https://i.imgur.com/oDoivba.png)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Plot the raster image in 3D." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "geemap.plot_raster_3d('srtm90.tif', factor=2, cmap='terrain', background='gray')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "![](https://i.imgur.com/UQDbV2G.gif)" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" } }, "nbformat": 4, "nbformat_minor": 5 }