Surface Mining Screening
Products used: gm_s2_annual, s1_rtc, wofs_ls_summary_annual
Keywords: data used; sentinel-2 geomedian, data used; WOfS, analysis; change monitoring, use case; surface mining, data used; sentinel-1
Background
Surface mining refers to the removal of the terrain surface to access minerals underneath. In particular, surface mining is used to retrieve sand, gravel, stones, coal, iron and other metals. Surface mining is often more cost-effective than gouging tunnels and subterranean shafts to access minerals underground.
Although surface mining contributes to the source of income for a country, these operations can result in deleterious impacts on farmlands, forests, and water bodies. Government officials are making efforts to identify areas of these mining activities.
This notebook demonstrates a method for identifying areas of surface mining activity. The notebook combines methods based on vegetation loss and water detection. Although the notebook aids in detecting these areas, further verification by government agencies or institutions are required to validate the operations on the ground.
Description
Surface mining operations often result in the clearing of vegetation and the development of water from the land. Using remote sensing images from Sentinel-2 GEOMAD or Sentinel-1, and DE Africa’s Water Observations from Space (WOfS) product, this notebook screen areas where there is a possibility of surface mining.
The notebook uses Normalised Difference Vegetation Index (for sentinel-2) or the Radar Vegetation Index (for sentinel-1) to determine vegetation loss, where loss occurs if the change in vegetation index is negative. DE Africa’s WOfS product is used to identify water.
The final product identifies pixels that exhibit vegetation loss, and the presence of water. In most cases, these algorithms can be used to identify clusters of pixels that have experienced change and allow targeted investigation of those areas by local or regional governments.
The notebook demonstrates how to:
Load data for a given location and time period
Calculate the vegetation change
Calculate the presence of water
Combine vegetation change and water extent change into one plot to show possible mining areas
Getting started
Load packages
[1]:
# Import functions for this notebook
from Surface_mining_screening import run_surface_mining_screening
Analysis parameters
The following cell sets the parameters, which define the area of interest and the length of time to conduct the analysis over. The area of interest must be defined with a shapefile (.shp), a geojosn (.geojson), or a KML file (.kml).
The parameters are:
start_year: The year to start the analysisend_year: The year to end the analysisproduct: whether oto use Sentinel-2 or sentinel-1 for the analysis, acceptable values are's2'or's1'threhold: The threshold to use for indentifying vegetaton loss, this can either be a float e.g.-0.15, or'otsu', in which case the threshold will be automatically identified using the otsu method.vector_file: The file path and name of a vector file containing the extent. Can be a.kmlfile, or a.shpfile.
If running the notebook for the first time, keep the default settings below. This will demonstrate how the analysis works and provide meaningful results. The example covers part of the Essen Apam Forest Reserve, Ghana, and uses the shapefile provided in Supplementary Data.
[2]:
start_year = 2017
end_year = 2025
product= 's2'
threshold = -0.1
buffer_m = 90
vector_file = "./data/Apam_forest.shp"
Note, if the product used is Sentinel-1, this cell can take a few minutes to run as annual medians are calculated on-the-fly
[3]:
run_surface_mining_screening(vector_file, start_year, end_year, product= product, threshold=threshold, buffer_m=buffer_m)
Loaded AOI vector (interactive preview may have been displayed)
Loaded imagery and water summary; applied AOI mask
Vegetation loss threshold used: -0.1
Computed possible mining masks
| metric | value | |
|---|---|---|
| 0 | total_aoi_area_km2 | 36.2628 |
Summary metadata (also saved to CSV)
| year | any_veg_loss_km2 | any_veg_loss_% | veg_loss_in_from_mining_km2 | veg_loss_in_from_mining_% | |
|---|---|---|---|---|---|
| 0 | 2017 | 0.0000 | 0.000000 | 0.0000 | 0.000000 |
| 1 | 2018 | 5.0655 | 13.968861 | 2.3429 | 6.460891 |
| 2 | 2019 | 1.0328 | 2.848098 | 0.9965 | 2.747995 |
| 3 | 2020 | 17.8869 | 49.325755 | 9.7129 | 26.784749 |
| 4 | 2021 | 8.2092 | 22.638075 | 7.6471 | 21.088002 |
| 5 | 2022 | 2.8919 | 7.974839 | 2.3163 | 6.387538 |
| 6 | 2023 | 2.4202 | 6.674057 | 2.0398 | 5.625048 |
| 7 | 2024 | 6.5555 | 18.077755 | 4.2936 | 11.840233 |
| 8 | 2025 | 1.9838 | 5.470620 | 0.9089 | 2.506425 |
Summary by year (also saved to CSV)
Exported CSV tables to results folder
Exported GeoTIFF outputs to results folder
Exported yearly vegetation loss GeoTIFFs
Quick-look RGB composites (displayed)
Saved RGB composites per year (PNG, dpi=300)
Possible mining map
Vegetation loss time series
Two-panel RGB + Vegetation loss from mining
Done ✅ All outputs are saved in the results folder.
[3]:
{'out_dir': 'results',
'summary_by_year': year any_veg_loss_km2 any_veg_loss_% veg_loss_in_from_mining_km2 \
0 2017 0.0000 0.000000 0.0000
1 2018 5.0655 13.968861 2.3429
2 2019 1.0328 2.848098 0.9965
3 2020 17.8869 49.325755 9.7129
4 2021 8.2092 22.638075 7.6471
5 2022 2.8919 7.974839 2.3163
6 2023 2.4202 6.674057 2.0398
7 2024 6.5555 18.077755 4.2936
8 2025 1.9838 5.470620 0.9089
veg_loss_in_from_mining_%
0 0.000000
1 6.460891
2 2.747995
3 26.784749
4 21.088002
5 6.387538
6 5.625048
7 11.840233
8 2.506425 ,
'summary_meta': metric value
0 total_aoi_area_km2 36.2628,
'threshold_used': -0.1}
Additional information
License: The code in this notebook is licensed under the Apache License, Version 2.0. Digital Earth Africa data is licensed under the Creative Commons by Attribution 4.0 license.
Contact: If you need assistance, please post a question on the Open Data Cube Slack channel or on the GIS Stack Exchange using the open-data-cube tag (you can view previously asked questions here). If you would like to report an issue with this notebook, you can file one on
Github.
Compatible datacube version:
[4]:
import datacube
print(datacube.__version__)
1.9.11
Last Tested:
[5]:
from datetime import datetime
datetime.today().strftime('%Y-%m-%d')
[5]:
'2026-02-12'