Mining activities can cause substantial environmental degradation, especially when operations expand beyond their permitted lease boundaries. Unfortunately, manual delineation of mine extents is labor-intensive, inconsistent, and difficult to scale. Moreover, official mining lease shapefiles may not reflect the full spatial impact of mining operations, particularly in areas with limited monitoring or regulatory oversight.
This script addresses these challenges by providing an automated, scalable method to detect potential mining areas using multi-year Landsat 8 surface reflectance imagery, terrain data, and spectral indices, all processed through Google Earth Engine (GEE). By combining vegetation and soil indicators with topographic context, the method helps identify land disturbances likely related to mining. It is especially valuable for researchers, government agencies, and civil society organizations focused on land use monitoring, environmental compliance, and resource governance.
- Authenticates with Google Earth Engine via service account
- Loads and displays mining lease shapefile
- Filters and masks cloud-free Landsat 8 SR imagery (2021β2023)
- Computes terrain attributes: elevation, slope, and relative depth
- Calculates spectral indices: NDVI, NDBI, BSI
- Applies a multi-criteria mask to detect likely mining land use
- Enhances the mask with morphological dilation
- Converts raster mask to polygon vector
- Filters polygons by area > 5000 mΒ²
- Visualizes results with
geemap - Exports shapefile to Google Drive
Install the required Python libraries:
pip install earthengine-api geemap geopandas- Shapefile of mining leases (e.g.
Lease_Maluku.shp) - Google Earth Engine service account and JSON key file
-
Replace your GEE service account email and path to JSON key in:
service_account = '[email protected]' key_file = 'path/to/your-key.json'
-
Update the path to your lease shapefile:
shp_path = "path/to/Lease_Maluku.shp"
-
Run the script in a Jupyter Notebook or Python environment.
The detection is based on these criteria:
- Low NDVI (< 0.4) β sparse vegetation
- High BSI (> 0) β exposed bare soil
- NDBI > -0.1 β built-up or disturbed land
- Slope > 10Β° and Relative Depth > 20 m β terrain factors
- Morphological dilation helps merge fragmented patches
Only solid polygons > 5000 mΒ² are retained and exported.
- Shapefile named
mining_Maluku_L8_dilated.shpin your Google Drive under folderGEE_exports - Visual results displayed in an interactive map
The map will display:
- π‘ Yellow polygons: Lease boundary
- π΄ Red mask: Initial detected areas after morphological filtering
- π Orange raster: Final solid mining detection
