Skip To Content ArcGIS for Developers Sign In Dashboard

ArcGIS API for Python

Download the samples Try it live

Predict Floods with Unit Hydrographs

Estimate stream runoff during a predicted rainstorm in Vermont.

Introduction

Stowe, a small Vermont town of nearly 5,000 residents, suffered considerably when the remnants of Hurricane Irene stuck the Green Mountain region in August 2011. The Little River overflowed and washed out roads, bridges, and culverts. Wanting to learn from the tragedy, Stowe officials discovered that they had precious little information involving flood prediction. They turned to hydrographs, which are line graphs determining how much water a stream will discharge during a rainstorm. In this notebook, you'll create those hydrographs.

Overwiew of the steps to be followed:

steps:

  • Remove imperfections in elevation model: Fill sinks in your elevation model to remove small imperfections in the data.

  • Delineate the watershed: Find the contributing area above a set of cells in an elevation model.

  • Create a velocity field: Determine how fast water flows with a spatially variant, time- and discharge-invariant velocity field.

  • Create an isochrone map: Assess the time it takes water to follow the flow path.

  • Create a unit hydrograph: Use the isochrone map to create a unit hydrograph for the outlet.

Necessary imports

In [1]:
from arcgis.gis import GIS
from datetime import datetime as dt

from arcgis.raster.functions.gbl import flow_direction, sink, fill, flow_accumulation, snap_pour_point, watershed
from arcgis.raster.functions import slope, raster_calculator, con
from arcgis.raster.analytics import convert_feature_to_raster

Connect to your GIS

In [2]:
gis = GIS(url='https://pythonapi.playground.esri.com/portal', username='arcgis_python', password='amazing_arcgis_123')

Get data for analysis

The data is available here to download and can be published for completing the workflow.

We need the following layers layers include the following:

Pour_point—A point feature layer that depicts the outlet downstream of the Little River where you'll create a unit hydrograph.

Stowe_boundary—A polygon feature layer that depicts the boundaries of Stowe, Vermont. This layer was derived from data available from Vermont Center for Geographic Information (VCGI).

Stowe_surface_water—A raster layer that depicts all surface water bodies in the area of interest. This raster layer's resolution is 30 meters, which means that each cell in the layer has an area of 30 square meters. The layer was derived from features in the NHDPlus Version 2 dataset.

Stowe_DEM—A raster layer that depicts elevation within the study area. It also has a resolution of 30 meters. It was derived from data made available by the United States Geological Survey (USGS).

Stowe_velocity_example—A raster layer that depicts a spatially-variant, time- and discharge-invariant velocity field for the study area. You'll learn how to create this layer in a later lesson (this example is provided as a backup). For now, you don't need this layer, so it's turned off.

In [7]:
item = gis.content.search('StoweHydrograph owner:api_data_owner', 'feature layer', outside_org=True)[0]
In [8]:
item
Out[8]:
StoweHydrograph
StoweHydrographFeature Layer Collection by api_data_owner
Last Modified: April 08, 2020
0 comments, 1 views
In [9]:
pour_point = item.layers[0]
stowe_boundary = item.layers[0]
In [11]:
stowe_dem_item = gis.content.search('stowe_DEM owner:api_data_owner', 'imagery layer')[0]
stowe_dem_item
Out[11]:
Stowe_DEM
A raster layer that depicts elevation within Stowe, Vermont.Imagery Layer by api_data_owner
Last Modified: April 08, 2020
0 comments, 0 views
In [12]:
stowe_dem = stowe_dem_item.layers[0]
In [13]:
stowe_surface_water_item = gis.content.search('stowe_surface_water owner:api_data_owner', 'imagery layer')[0]
In [15]:
stowe_surface_water_item
Out[15]:
Stowe_surface_water
A raster layer that depicts all surface water bodies in Stowe, Vermont.Imagery Layer by api_data_owner
Last Modified: April 08, 2020
0 comments, 0 views
In [14]:
stowe_surface_water = stowe_surface_water_item.layers[0]
In [194]:
m1 = gis.map('Stowe, Vermont')
m1
Out[194]:
In [20]:
m1.add_layer(stowe_dem)
In [21]:
m1.add_layer(stowe_surface_water)
In [27]:
m1.add_layer(stowe_boundary)
In [19]:
m1.zoom_to_layer(stowe_boundary)
In [26]:
m1.add_layer(pour_point)

Remove imperfections in elevation model

Some DEMs contain sinks, which are areas of low elevation surrounded by higher elevation values. Sinks can occur naturally but are more often data errors in a DEM raster dataset. Because water has no way of flowing out of a sink, sinks can cause all kinds of errors when analyzing how water flows to an outlet. Before you begin your hydrological analysis of flooding potential in Stowe, you'll identify and remove sinks from your elevation data.

Identify sinks

First, you'll identify sinks in your DEM. Although your DEM was derived from reliable data provided by the USGS, sinks may still be present. To run an accurate hydrological analysis for the area around Stowe, you'll first need to locate sinks if any.

In [29]:
stowe_flow_direction = flow_direction(stowe_dem).save('stowe_flow_direction' + str(dt.now().microsecond))
In [37]:
stowe_flow_direction
Out[37]:
stowe_flow_direction916591
Analysis Image Service generated from GenerateRasterImagery Layer by portaladmin
Last Modified: July 03, 2020
0 comments, 0 views
In [197]:
m2 = gis.map('Stowe, Vermont')
m2
Out[197]: