This project is a web-based application that detects and analyzes water bodies from satellite imagery using the Modified Normalized Difference Water Index (MNDWI). It uses Google Earth Engine (GEE) for geospatial computation and Flask for backend deployment.
Users can:
- Select a date
- Draw a region of interest (ROI)
- Detect water bodies
- View total area and count
- Download results as GeoJSON
- Interactive map (Leaflet.js)
- Real-time Sentinel-2 imagery
- Water detection using MNDWI
- Computes:
- Number of water bodies
- Total area (sq. km)
- GeoJSON export
- Map visualization with overlays
- Sentinel-2 Harmonized dataset (Google Earth Engine)
- Filter images by ROI, date (±15 days), and cloud cover (<30%)
- Compute MNDWI: MNDWI = (Green - SWIR) / (Green + SWIR)
- Thresholding:
- Water pixels → MNDWI > 0
- Convert raster → vector polygons
- Remove small regions (< 100,000 m²)
- Merge fragmented water bodies
Backend
- Python
- Flask
- Google Earth Engine API
- Geemap
Frontend
- HTML, CSS
- Leaflet.js + Leaflet Draw
Geospatial
- GeoJSON
- Remote sensing (Sentinel-2)
-
Root Directory
a. app.py
b. requirements.txt -
templates/
a. index.html
b. result.html
c. map.html -
static/
a. draw.js
b. style.css
c. geojson/
i. water.geojson j. water_bodies.geojson
git clone https://github.com/gauranggupta0786/WaterSemanticSegmentation.git cd WaterSemanticSegmentation
pip install -r requirements.txt
pip install -r requirements.txt
In app.py, replace: ee.Initialize(project='your-project-id')
python app.py
Open in browser: http://127.0.0.1:5000/
Author Gaurang Gupta BITS Pilani – Computer Science