Uncomment the following line to install leafmap if needed.
# !pip install leafmap
import os
import leafmap
Download a sample dataset.
url = "https://open.gishub.org/data/raster/srtm90.tif"
image = "srtm90.tif"
if not os.path.exists(image):
leafmap.download_file(url, image)
Plot the raster image in 2D.
leafmap.plot_raster(image, cmap="terrain", figsize=(15, 10))
Plot the raster image in 3D.
leafmap.plot_raster_3d("srtm90.tif", factor=2, cmap="terrain", background="gray")