Naqsha is an experimental urban-flood planning tool for Lahore, Pakistan. The first milestones are deliberately data-first: they test whether freely available terrain can support useful flood modelling over a 5–25 km² pilot, then expose the resulting uncertainty in an interactive 3D viewer.
cd web
npm ci
npm run devOpen http://localhost:5174. The checked-in data are enough to explore both
study areas; Docker and the Python pipeline are only needed to regenerate
models and assets.
Search for a place or road, play the storm timeline, or click the map to inspect a location. Storm, Roads and Layers keep the main controls separate. About explains the data and model limitations. The displayed example is 100 mm over two hours, not a live forecast. See the viewer guide for result definitions and shortcuts.
The terrain audit:
- validates a GeoJSON pilot boundary;
- reads the public Copernicus GLO-30 terrain tile covering it;
- clips and reprojects the terrain to UTM zone 43N;
- writes a clipped GeoTIFF, hillshade, machine-readable metrics, and a short Markdown quality report;
- compares the raw Copernicus surface against FABDEM's building/forest-removed derivative to measure how strongly conditioning changes local routing;
- tests all three surfaces against the one public ICESat-2 ATL08 pass found crossing the central Lahore candidate;
- runs the same synthetic storm through three pinned SFINCS 2.4.0 models and exports 10-minute water-depth timelines, maximum-depth rasters, and terrain-agreement rasters;
- packages those grids into compact browser assets and presents them in an uncertainty-first Three.js viewer;
- adds frozen public-data city layers for central Lahore and Gulberg–Liberty, together containing 43,661 building footprints and 6,447 mapped road/rail/water/park segments;
- optionally drapes live OSM cartography over the terrain and renders either instantaneous or peak flood depth as an explicitly display-exaggerated 3D volume;
- intersects every hydraulic frame with the mapped road network, colours exposed segments, and ranks named roads and neighbourhood-label vicinities;
- archives 51-member weather-model rainfall forecasts as reproducible p10/p50/p90 forcing trajectories accepted directly by SFINCS.
The app includes two deliberately different areas: central Lahore is the evidence-led validation benchmark; Gulberg–Liberty is a provisional expansion area. Neither has passed the accuracy gate for authoritative depths.
Docker is the only host dependency for the reproducible path:
make build
make auditOutputs are written to artifacts/terrain/. The first run needs internet
access to read the public Copernicus Cloud Optimized GeoTIFF.
Run the conditioning comparison with make compare (container) or
make compare-local (local virtual environment). FABDEM is licensed for
non-commercial use; it is an evaluation input, not yet an unconditional
production dependency.
Run the three-surface screening-stability gate with make ensemble or
make ensemble-local. This adds the AWS open SRTM-family terrain surface and
reports whether broad low-area rankings persist across all three inputs.
After generating the central Lahore terrain ensemble, run
make elevation-control-local to download and audit the 28 August 2025
ICESat-2 pass. The raw CSV and generated outputs are ignored; the retrieval and
quality-gate logic are versioned. Only eight in-bound estimates meet the
liberal 5 m reported-uncertainty filter, so this is independent context rather
than a substitute for a local DTM.
The first experimental hydraulic slice is fully runnable with Colima/Docker:
make central-ensemble-local
make hydraulic-build-local
make hydraulic-run
make hydraulic-results-localIt applies 100 mm over two hours, followed by two hours of recession, with a
uniform 5 mm/h effective surface-loss sensitivity. These are synthetic,
uncalibrated assumptions. Results are written under
artifacts/hydraulic-results/rain100mm-2h-loss5/; see the
hydraulic ensemble decision before
interpreting them.
The precomputed 3D viewer can then be run locally:
make web-install
make web-devOpen http://localhost:5174. The checked-in scenario assets are enough to use
the viewer without rerunning SFINCS. Select either district in the top bar, or
open ?area=gulberg-liberty directly. To regenerate them from local hydraulic
artifacts, run make web-export-local. A containerized production build is
available with docker compose up --build viewer (or docker-compose on an
older Compose installation). See the viewer design and data contract
and the Google Photorealistic 3D Tiles decision.
The checked-in city extract is sufficient to run the app. To reproduce it from
the public Overture and OpenStreetMap sources, follow the
urban-context decision or run the three
make urban-context-* targets documented there.
The forecast path is operational but intentionally does not treat one weather model as certainty. It archives actual ensemble-member trajectories nearest the whole-event p10, p50, and p90 rainfall totals:
make forecast-central-local
make forecast-hydraulic-build-local FORECAST_PROFILE=p90
make forecast-hydraulic-run FORECAST_PROFILE=p90
make forecast-hydraulic-results-local FORECAST_PROFILE=p90The archive records provider, model, grid point, retrieval time, valid period, member count, and every hourly forcing value. The current command uses the ECMWF IFS ensemble through Open-Meteo over a 72-hour horizon. This global model does not resolve neighbourhood convection, so results remain scenario bands, not a deterministic warning. See forecast and road impacts.
Run the automated tests with:
make testFor local development with Python 3.12 or newer, create .venv, install with
pip install -e '.[dev]', then use make test-local or make audit-local.
data/aoi/ versioned study boundaries
docs/ architecture and data decisions
src/naqsha/ reproducible data/model tooling
tests/ offline automated tests
artifacts/ generated reports and rasters (ignored)
web/ React/Three.js viewer and compact scenario assets
Computational resolution is not evidence resolution. Copernicus GLO-30 is a 30 m digital surface model; interpolating it to a smaller cell size does not create street-level elevation. Every exported result must retain source, resolution, assumptions, and uncertainty metadata.