-
Hi, exploring the # ! pip install xarray_leaflet leafmap
import os
import leafmap.leafmap as leafmap
out_dir = os.path.expanduser('~/Downloads')
if not os.path.exists(out_dir):
os.makedirs(out_dir)
landsat = os.path.join(out_dir, 'landsat.tif')
dem = os.path.join(out_dir, 'dem.tif')
if not os.path.exists(landsat):
landsat_url = 'https://drive.google.com/file/d/1EV38RjNxdwEozjc9m0FcO3LFgAoAX1Uw/view?usp=sharing'
leafmap.download_from_gdrive(landsat_url, 'landsat.tif', out_dir, unzip=False, verbose=False)
if not os.path.exists(dem):
dem_url = 'https://drive.google.com/file/d/1vRkAWQYsLWCi6vcTMk8vLxoXMFbdMFn8/view?usp=sharing'
leafmap.download_from_gdrive(dem_url, 'dem.tif', out_dir, unzip=False, verbose=False)
Map = leafmap.Map()
Map.add_raster(dem, colormap='terrain', layer_name='DEM')
Map.add_raster(landsat, bands=[5, 4, 3], layer_name='Landsat')
# Map class is not displayed
Map |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
The add_raster function relies on xarray-leaflet, which only supports ipyleaflet. Colab don't not yet support ipyleaflet yet. You will need Jupyter to run this example. Also, xarray-leaflet does not support Windows. See https://github.com/davidbrochart/xarray_leaflet/issues/30 |
Beta Was this translation helpful? Give feedback.
-
I have added a binder icon to each notebook. You can run the notebook examples using the link below. |
Beta Was this translation helpful? Give feedback.
The add_raster function relies on xarray-leaflet, which only supports ipyleaflet. Colab don't not yet support ipyleaflet yet. You will need Jupyter to run this example. Also, xarray-leaflet does not support Windows. See https://github.com/davidbrochart/xarray_leaflet/issues/30