05 load raster
Loading local raster datasets with leafmap
Uncomment the following line to install leafmap if needed.
1 | |
To follow this tutorial, you need to install the leafmap and xarray_leaflet Python packages. Use the following conda commands to create a conda env and install packages. Note that xarray_leaflet does not work properly on Windows (source). Also, the add_raster function is only available for the ipyleaflet plotting backend. Therefore, Google Colab is not supported. Use the binder link above instead.
conda create -n gee pythonconda activate geeconda install mamba -c conda-forgemamba install leafmap xarray_leaflet -c conda-forge
Use the ipyleaflet plotting backend. The folium plotting backend does not support the add_raster function.
1 2 | |
Specify input raster datasets
1 2 | |
Download samples raster datasets
More datasets can be downloaded from https://viewer.nationalmap.gov/basic/
1 2 3 4 | |
Create an interactive map
1 | |
Add local raster datasets to the map
More colormap can be found at https://matplotlib.org/3.1.0/tutorials/colors/colormaps.html
1 | |
1 | |
Display the map
1 | |