Geospatial / Environmental analysis
Mapping agricultural water use in Morocco
How much does pixel selection change a water-use estimate at the edge of a Moroccan lagoon?
Solution
I mapped FAO WaPOR rasters in Leaflet and cross-checked area-weighted water-use estimates in PostGIS.
My contribution · I computed the zonal estimates, verified them in both Python and PostGIS, and built the Leaflet atlas.
Tools Python · Rasterio · PostGIS · QGIS · Leaflet
Results
At the lagoon edge in 2023, evapotranspiration was 506.95 mm/year with area weighting and 257.70 mm/year at the centroid.
PostGIS and Python agreed on all sixteen summaries, including a repeated database load.
- Area-weighted AETI, lagoon edge
- 506.95 mm/year Source
Data & evaluation
Data sources
- FAO WaPOR v3 AETI and gross biomass water productivity rasters, 2022–2023
Method
- Intersect pixel footprints with two study polygons in equal-area coordinates and check the calculations independently in PostGIS.
- Read windows from eight revision-pinned rasters, compare centroid, cell-centre and area-weighted estimates, and expose year, resolution and indicator in a local Leaflet atlas.
Limitations
The two zones are study polygons containing mixed land cover. Remote estimates need field observations for agronomic validation.
WaPOR estimates evapotranspiration. Estimating irrigation withdrawals or validating at field scale requires independent withdrawal records and in-field measurements.
Reproduce the study
Use Python 3.13 and Docker Compose. Prepare the pinned WaPOR inputs, start PostGIS, then run the zonal checks and atlas setup.
Local reproduction instructions and pinned sourceSkills demonstrated
- Area-weighted zonal statistics
- Spatial SQL
- Raster validation
Project figures

The 100 m and 300 m grids resolve the lagoon boundary differently. Both maps share one annual evapotranspiration scale.
Adapted from FAO WaPOR v3 annual AETI (2023), CC BY 4.0. Analysis by Idriss Lemnouni.Figure source
On the 2023 100 m grid, the lagoon-edge estimate was 506.95 mm/year weighted by area and 257.70 mm/year at the centroid.
Adapted from FAO WaPOR v3 (2022–2023), CC BY 4.0. Analysis by Idriss Lemnouni.Figure source