Keywords: data used; waterbodies


The Digital Earth Africa continental Waterbodies Monitoring Service identifies more than 700,000 water bodies from over three decades of satellite observations. This service maps persistent and seasonal water bodies and the change in their water surface area over time. Mapped water bodies may include, but are not limited to, lakes, ponds, man-made reservoirs, wetlands, and segments of some river systems.

On a local, regional, and continental scale, this service helps improve our understanding of surface water dynamics and water availability and can be used for monitoring water bodies such as wetlands, lakes and dams in remote and/or inaccessible locations.

The service offers two products:

  • The DE Africa Waterbodies Historical Extent

  • The DE Africa Waterbodies Surface Area Change

The DE Africa Waterbodies Historical Extent product is a static polygon-based view of the DE Africa Water Observations from Space All-Time Summary product. The historical extent represents where water has appeared in at least 5% of clear observations since 1987. It is not a capture of a water body’s true extent in any given year, but a record of where water has appeared since 1987. To be captured in the dataset, polygons must have an area of at least 4,500 metres squared (5 Landsat pixels). The historical extent polygons have been derived from the DE Africa Water Observations from Space All-Time Summary product, which provides historical surface water observations across the African continent.

For each water body, the Surface Area Change product provides the percentage of the historical extent that was classified as wet, dry, or invalid, for each DE Africa Water Observation from Space Feature Layer scene that captured the water body. This can be used to identify when water bodies are increasing or decreasing in wet surface area.

Disclaimer: DE Africa Waterbodies Surface Area Change measures the wet surface area of waterbodies as estimated from satellites. This product does not measure depth, volume, purpose of the waterbody, nor the source of the water.


  • Identify and analyse persistent and seasonal water bodies

  • Water resource management

  • Gain insights into the severity and spatial distribution of drought


This notebook will demonstrate how to load historical extents and wet surface area timeseries from the DE Africa Waterbodies service.

Topics covered include:

  1. Getting a list of available polygons in a given area

  2. Select and plot a single polygon

  3. Plotting the surface area of the polygon over time

Getting started

To run this analysis, run all the cells in the notebook, starting with the “Load packages” cell.

Load packages

Import Python packages that are used for the analysis.

import matplotlib.pyplot as plt

from deafrica_tools.plotting import display_map
from deafrica_tools.waterbodies import (

Analysis parameters

This section defines the analysis parameters, including:

  • lat, lon, buffer: center lat/lon and analysis window size for the area of interest (in degrees)

The default area is a water body in Mauritania.

# Set the central latitude and longitude
lat = 16.158
lon = -12.57

# Set the buffer to load around the central coordinates
buffer = 0.15

# Compute the bounding box coordinates
xlim = (lon-buffer, lon+buffer)
ylim =  (lat+buffer, lat-buffer)

# Preview area on a map
display_map(xlim, ylim)
Make this Notebook Trusted to load map: File -> Trust Notebook

Getting data

The deafrica_waterbodies module allows you to query water bodies by location or geohash.

List waterbody polygons in an area

We can get a list of waterbody polygons inside a bounding box of coordinates using get_waterbodies.

# Create a bounding box from study area coordinates
bbox = (xlim[0], ylim[1], xlim[1], ylim[0])

# Select all water bodies located within the bounding box
polygons = get_waterbodies(bbox, crs="EPSG:4326")
# Return GeoDataFrame with selected water bodies
id area_m2 length_m uid wb_id perim_m geometry
0 DEAfrica_Waterbodies.54162 824399.9998 2001.019212 edygwzf4xr 54162 14100 MULTIPOLYGON (((-12.70533 16.13250, -12.70471 ...
1 DEAfrica_Waterbodies.54165 28800.0000 356.527369 edygy8vvny 54165 1080 MULTIPOLYGON (((-12.71372 16.13446, -12.71341 ...
2 DEAfrica_Waterbodies.54166 9000.0000 194.154974 edygybgyrw 54166 540 MULTIPOLYGON (((-12.70657 16.13348, -12.70564 ...
3 DEAfrica_Waterbodies.54167 32400.0000 482.990792 edygybz8d5 54167 1440 MULTIPOLYGON (((-12.69973 16.13397, -12.69942 ...
4 DEAfrica_Waterbodies.54168 194399.9999 745.923607 edygyc2ws2 54168 3540 MULTIPOLYGON (((-12.71248 16.13910, -12.71217 ...

The returned geodataframe includes all the water bodies which are located within the bounding box. This dataset contains metadata for each water body in the dataset, including the ID, UID, WB_UID, area, perimeter and time series. See the Waterbodies Historical Extent documentation for descriptions of each attribute.

Displaying the polygons

Once the water body polygons are in memory, you can plot them directly, or explore them in an interactive window.

# Plot the waterbody polygons located within the bounding box
# Explore the waterbody polygons located within the bounding box
Make this Notebook Trusted to load map: File -> Trust Notebook


Every water body in DE Africa Water Bodies has a unique identifier (UID) called a geohash. The geohash of a water body is derived from its position, and this process can be reversed to obtain the location from the geohash. A waterbody’s geohash is contained under the UID attribute and can be obtained through DE Africa Maps by clicking on a waterbody.

Note: You might notice that these polygons have a range of similar geohash prefixes (‘edyg’ or ‘edz’). If two geohashes have a similar prefix, this means that they are close together.

Getting data for a specific water body

We can use the .explore() function above to interactively explore the subset of water bodies located within the bounding box. Hovering over a water body will display its attributes, including the water body’s geohash (UID). After noting the geohash from the .explore() function, we can use it to extract just that water body through the get_waterbody() function.

By default, try the geohash edz5cm96jh.

selected_waterbody_geohash = "edz5cm96jh"

selected_waterbody = get_waterbody(selected_waterbody_geohash)
id area_m2 length_m uid wb_id perim_m geometry
0 DEAfrica_Waterbodies.54637 1.865133e+08 28031.685226 edz5cm96jh 54637 252960 MULTIPOLYGON (((-12.62573 16.25456, -12.62542 ...

Plot the selected water body


Get the wet surface area time series for the selected waterbody

For any given geohash or a polygon, we can also use the get_time_series() function to get various measures of the water body surface over time. See the Waterbodies Historical Extent documentation for descriptions of the different surface measures.

The function also calculates a rolling median of the water body surface wet percentage. This is used to visualise the overall trend in the surface wet percentage. The rolling median uses the last three observations to determine the median at a given date.

# Get time series for the selected water body
selected_waterbody_timeseries = get_time_series(waterbody=selected_waterbody)

area_wet_m2 percent_wet area_dry_m2 percent_dry area_invalid_m2 percent_invalid area_observed_m2 percent_observed percent_wet_rolling_median
1984-05-28 39674700.0 21.27 146836800.0 78.73 1800.0 0.00 186513300.0 100.0 NaN
1984-07-15 99504900.0 53.35 87005700.0 46.65 2700.0 0.00 186513300.0 100.0 NaN
1984-08-25 115645500.0 62.00 70864200.0 37.99 3600.0 0.00 186513300.0 100.0 53.35
1984-09-01 80192700.0 43.00 96750900.0 51.87 9569700.0 5.13 186513300.0 100.0 53.35
1984-09-17 123178500.0 66.04 62281800.0 33.39 1053000.0 0.56 186513300.0 100.0 62.00

Display the wet surface area time series for the selected waterbody

After loading the water body time series, we can use the display_time_series() function to create an interactive visualisation of the time series.

The visualisation shows the invalid percentage and the wet percentage. The invalid percentage indicates the proportion of the water body that couldn’t be clearly observed. To provide the most representative measurements of water body surface area, the time series only contains values where the invalid percentage is lower than 10%.

There are some caveats to be aware of:

  • To appear in the time series, an observation must record clear observations of at least 90% of the water body’s surface area. If 10% or more of the surface area is covered by cloud or cloud shadow, the observation will be excluded. This can cause large gaps in the time series.

  • If the invalid percentage is high, it’s likely that the wet percentage is an underestimate of the true wet surface area.

  • Annual and seasonal trends should only be inferred during times with sufficient observations. You should take care when infering the surface water change across time when there are few observations.

  • The time series is based on the Water Observations from Space product, which has known limitations. See the DE Africa Waterbodies service documentation for more information.