A comprehensive remote sensing pipeline for monitoring water surface changes in Lake Urmia (Iran) using Sentinel-2 satellite imagery and Normalized Difference Water Index (NDWI) analysis.
Lake Urmia, once the largest saltwater lake in the Middle East, has experienced catastrophic water loss since the 1990s. This project provides an automated Python pipeline to:
- Analyze water surface area changes from 2019-2025
- Detect water bodies using NDWI thresholding
- Visualize spatiotemporal changes through animated GIFs
- Generate comprehensive water loss reports
- Create professional comparison plots
- Automated Analysis: Complete pipeline from raw data to insights
- Multi-Year Comparison: 2019-2025 annual water area analysis
- Professional Visualizations: RGB/NDWI side-by-side comparison plots
- Animated Timeline: GIF animations showing year-to-year changes
- Scientific Reports: Detailed water loss statistics and trends
- Geospatial Accuracy: Proper coordinate handling with degree formatting
| Year | Water Area (km²) | Change from Previous Year |
|---|---|---|
| 2019 | 4,205.92 km² | - |
| 2020 | 4,101.80 km² | -104.12 km² (-2.5%) |
| 2021 | 3,206.36 km² | -895.44 km² (-21.8%) |
| 2022 | 1,980.23 km² | -1,226.13 km² (-38.2%) |
| 2023 | 808.56 km² | -1,171.67 km² (-59.2%) |
| 2024 | 2,200.56 km² | +1,392.00 km² (+172.1%) |
| 2025 | 497.77 km² | -1,702.79 km² (-77.4%) |
Total Water Loss (2019-2025): 3,708.15 km² (88.2% reduction)
Line chart showing dramatic water loss from 2019-2025 with annual area labels
- Satellite: Sentinel-2 Level-2A (10m resolution)
- Bands: RGB (visualization) + NDWI calculation
- Processing: Google Earth Engine for cloud-free annual composites
- Time Period: 2019-2025 (June-September annual averages)
- NDWI Calculation: NDWI = (Green - NIR) / (Green + NIR)
- Green: Band 3 (560nm)
- NIR: Band 8 (842nm)
- Water Classification:
- Threshold: NDWI > 0.2 (empirically determined)
- Pixel size: 10m × 10m = 100 m² per pixel
- Area calculation:
Water Area (km²) = (Water Pixels × 100) / 1,000,000
- Visualization:
- Side-by-side RGB/NDWI comparison
- Proper georeferencing with latitude/longitude coordinates
- Consistent color scales across years
- Animated GIF creation
Before starting, ensure you have:
- Python 3.8 or higher installed
- Google Earth Engine account (free for research/educational use)
- Git installed on your system
- 10+ GB free disk space for satellite imagery
git clone https://github.com/SaeidTaleghani/Water-Change-Detection.git
cd Water-Change-Detection# Create a virtual environment
python -m venv venv
# Activate the virtual environment
# On Windows:
venv\Scripts\activate
# On macOS/Linux:
source venv/bin/activate
# Install required packages
pip install -r requirements.txt-
Sign up for a free Google Earth Engine account
Visit earthengine.google.com/signup and create an account (free for research and educational purposes). -
Open the Google Earth Engine Code Editor
Go to code.earthengine.google.com and sign in with your Google account. -
Copy and paste the download script
- Open the
gee_download_S2.jsfile from this repository - Copy the entire contents of the file
- Paste it into the Google Earth Engine Code Editor
- Open the
-
Click Run to execute the script
Click the Run button (▶️ ) in the Code Editor toolbar to execute the script. -
Go to the Tasks tab and run export tasks
- Navigate to the Tasks tab in the right panel
- You'll see export tasks for each year (2019-2025)
- Click Run next to each task to start the exports
⚠️ Note: This may take 10-30 minutes for all tasks
-
Download the exported GeoTIFF files from your Google Drive
- Open Google Drive
- find the exported GeoTIFF files
- Download all files to your computer
-
Create an
Images/folder in the project directory# In your project folder mkdir Images -
Place downloaded files in the Images/ folder
python map_water_change.py