102 blend hillshade
Creating a shaded relief map by blending DEM and hillshade
Uncomment the following line to install geemap if needed.
In [ ]:
Copied!
# !pip install geemap
# !pip install geemap
Import libraries
In [ ]:
Copied!
import ee
import geemap
import geemap.colormaps as cm
import ee
import geemap
import geemap.colormaps as cm
Create an interactive map
In [ ]:
Copied!
Map = geemap.Map()
Map
Map = geemap.Map()
Map
Add DEM and hillshade to the map
In [ ]:
Copied!
dem = ee.Image("CGIAR/SRTM90_V4")
hillsahde = ee.Terrain.hillshade(dem)
dem = ee.Image("CGIAR/SRTM90_V4")
hillsahde = ee.Terrain.hillshade(dem)
In [ ]:
Copied!
vis = {"min": 0, "max": 6000, "palette": cm.palettes.dem}
vis = {"min": 0, "max": 6000, "palette": cm.palettes.dem}
In [ ]:
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 [ ]:
Copied!
blend = geemap.blend(top_layer=dem, top_vis=vis)
blend = geemap.blend(top_layer=dem, top_vis=vis)
In [ ]:
Copied!
Map.addLayer(blend, {}, "Blend")
Map.addLayer(blend, {}, "Blend")
Add NLCD land cover to the map
In [ ]:
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 [ ]:
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 [ ]:
Copied!
Map.addLayer(result, {}, "Blend NLCD")
Map.addLayer(result, {}, "Blend NLCD")