Inspiration
Lahore’s monsoon flooding can turn a short storm into hours of disruption. Rain forecasts, terrain, roads, buildings, and flood models all exist separately—and their outputs are rarely understandable to ordinary users.
I built Naqsha to explore a simple idea: what if a rainfall forecast could become a recognizable 3D flood scenario before the rain arrives?
## What it does
Naqsha is a forecast-ready 3D urban-flood lab for Lahore. It currently models Central Lahore and Gulberg–Liberty using:
- 43,661 public building footprints
- 6,447 mapped infrastructure segments
- 746 neighbourhood, road, landmark, and POI labels
- three terrain models: Copernicus, FABDEM, and SRTM
- real SFINCS hydraulic output at ten-minute intervals
Users can watch water build up and recede, compare terrain-dependent predictions, identify flooded neighbourhoods, and see which named roads may be most exposed.
Naqsha can also convert a 51-member ECMWF rainfall forecast into p10, p50, and p90 hydraulic scenarios.
## How I built it
Our Python pipeline aligns three public elevation products, constructs equivalent SFINCS flood models, runs rainfall scenarios, and exports compact browser-ready grids.
I combine these results with Overture building footprints and current OpenStreetMap roads, infrastructure, names, and points of interest.
The web experience uses React, TypeScript, Three.js, and WebGL to render terrain, solid buildings, animated 3D flood volumes, road impacts, map labels, and model-agreement layers.
## Challenges
Our biggest challenge was terrain accuracy. Lahore is extremely flat, so small elevation errors can reverse the predicted direction of water flow. Instead of selecting one convenient terrain source, I run all three and show where their predictions agree.
I also had to balance realism with honesty. Most building heights are unavailable, and the terrain grid is approximately 29 metres. Treating every building as a surveyed hydraulic wall would create false precision, so building footprints currently improve visual recognition without being presented as authoritative obstacles.
Finally, connecting raster flood depths to actual roads required a separate spatial sampling pipeline that evaluates every road across every hydraulic frame.
## What I learned
Our main lesson was: computational resolution is not evidence resolution.
A model can calculate a value for every cell without that value being authoritative. Uncertainty must influence the entire product—not just appear as a disclaimer.
I also learned that a recognizable visual twin can be built from public data, but an authoritative hydraulic twin requires local terrain surveys, drainage infrastructure, rainfall gauges, and observed flood depths.
## What’s next
Next, I want to add local high-resolution terrain, drains, inlets, pumps, culverts, road levels, and historical flood observations. I also plan to automate forecast refreshes and expand Naqsha into DHA, Johar Town, Model Town, and other Lahore flood hotspots.
Naqsha is not yet a public warning system. It is a transparent, working foundation for one.
Built With
- cloudflare
- colima
- copernicus
- docker
- ecmwf
- fabdem
- geojson
- gis
- hydrology
- numpy
- open-meteo
- openstreetmap
- overture
- pyproj
- python
- rasterio
- react
- sfincs
- shapely
- srtm
- three.js
- typescript
- vite
- vitest
- webgl

Log in or sign up for Devpost to join the conversation.