# hw-lidar - Earth analytics python course module

Welcome to the first lesson in the hw-lidar module. This module covers how overlay rasters to create visualizations and how to make interactive plots.

## Learning Objectives

After completing this tutorial, you will be able to:

• Overlay 2 rasters in Python to create a plot.

## What You Need

You need Python and Jupyer Notebook to complete this tutorial. You should also have an earth-analytics directory setup on your computer with a data subdirectory within it. You should have completed the lesson on Setting Up the Conda Environment..

import rasterio as rio
import numpy as np
import matplotlib.pyplot as plt
import os
import earthpy as et
plt.ion()
# Set working directory
os.chdir(os.path.join(et.io.HOME, 'earth-analytics'))


## Overlay Rasters in Python

In this lesson, you will learn about overlaying rasters on top of a hillshade for nicer looking plots in python. To overlay a raster will will plot two different raster datasets in the same plot in matplotlib. You will use alpha to adjust the transparency of one of your rasters so the terrain hillshade gives the raster texture! Also you will turn of the legend for the hillshade plot as the legend we want to see is the DEM elevation values.

A hillshade is a representation of the earth’s surface as it would look with shade and shadows from the sun. You often render a hillshade using a greyscale colorramp.

Hillshades make nice underlays for other data as they emphasize the topography visually. This adds depth to your map!

To begin, open up both the Digital Terrain Model and the Digital terrain model hillshade files.

# Open raster DTM data


fig, ax = plt.subplots(figsize = (10,6))