102 blend hillshade
Creating a shaded relief map by blending DEM and hillshade
Uncomment the following line to install geemap if needed.
In [1]:
Copied!
# !pip install geemap
# !pip install geemap
Import libraries
In [2]:
Copied!
import ee
import geemap
import geemap.colormaps as cm
import ee
import geemap
import geemap.colormaps as cm
Create an interactive map
In [3]:
Copied!
Map = geemap.Map()
Map
Map = geemap.Map()
Map
Out[3]:
Make this Notebook Trusted to load map: File -> Trust Notebook
Add DEM and hillshade to the map
In [4]:
Copied!
dem = ee.Image("CGIAR/SRTM90_V4")
hillsahde = ee.Terrain.hillshade(dem)
dem = ee.Image("CGIAR/SRTM90_V4")
hillsahde = ee.Terrain.hillshade(dem)
In [5]:
Copied!
vis = {'min': 0, 'max': 6000, 'palette': cm.palettes.dem}
vis = {'min': 0, 'max': 6000, 'palette': cm.palettes.dem}
In [6]:
Copied!
Map.addLayer(hillsahde, {}, 'Hillshade')
Map.addLayer(dem, vis, 'DEM')
Map.addLayer(hillsahde, {}, 'Hillshade')
Map.addLayer(dem, vis, 'DEM')
Create a blended image by blending DEM and hillshade
In [7]:
Copied!
blend = geemap.blend(top_layer=dem, top_vis=vis)
blend = geemap.blend(top_layer=dem, top_vis=vis)
In [8]:
Copied!
Map.addLayer(blend, {}, 'Blend')
Map.addLayer(blend, {}, 'Blend')
Add NLCD land cover to the map
In [9]:
Copied!
nlcd = ee.Image("USGS/NLCD_RELEASES/2019_REL/NLCD/2019").select('landcover')
nlcd_vis = {'bands': ['landcover']}
Map.addLayer(nlcd, nlcd_vis, 'NLCD')
nlcd = ee.Image("USGS/NLCD_RELEASES/2019_REL/NLCD/2019").select('landcover')
nlcd_vis = {'bands': ['landcover']}
Map.addLayer(nlcd, nlcd_vis, 'NLCD')
Create a blended image by blending NLCD and DEM.
In [10]:
Copied!
result = geemap.blend(nlcd, dem, top_vis=nlcd_vis, expression='a*b')
result = geemap.blend(nlcd, dem, top_vis=nlcd_vis, expression='a*b')
In [11]:
Copied!
Map.addLayer(result, {}, 'Blend NLCD')
Map.addLayer(result, {}, 'Blend NLCD')
Last update:
2022-03-14