O'Reilly logo

Python Geospatial Analysis Cookbook by Michael Diener

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Merging rasters to generate a color relief map

Generating a color relief raster is a one-liner with the gdaldem color-relief command line. If you want something that's a little more visually appealing, we will perform a combination of a slope, hillshade, and some color relief. Our end result is a single new raster representing a merge of layers to give a nice visual effect of elevation relief. The results are going to look similar to the following image:

Merging rasters to generate a color relief map

Getting ready

For this exercise, you need to have the GDAL libraries installed that include the gdaldem command-line tool.

How to do it...

  1. Let's begin by extracting some key information out of our DEM ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required