LLM GIS agent + benchmark
KeralaFloodBench
An AI agent that answers questions about the 2018 Kerala floods by writing and running real GIS code on satellite radar, elevation and map data.
When a small model fails at GIS, you can’t tell why. I built a frozen benchmark that separates “chose a different expert setting” from “couldn’t run the analysis”.
- RoleSolo project · built on the open-source GISclaw agent
- Year2026
- StackPython · GeoPandas · Rasterio · Shapely · Ollama · Sentinel-1 · Copernicus DEM · OpenStreetMap

01Problem
Questions like “how many hospitals in Alappuzha were flood-affected?” need a GIS analyst’s expert choices: the radar water threshold, the buffer distance, a point versus a polygon. When an LLM agent gets them wrong, is it missing the expertise — or failing to run the analysis?
02Approach
- An agent layer on top of GISclaw: a ReAct loop with a Python sandbox and geoprocessing tools, plus an AnswerChecker that rejects implausible answers (wrong unit, an area computed in degrees) and lets the agent retry.
- A domain pack serves each expert parameter with its value, unit and provenance through a domain_param tool.
- A frozen, hash-locked benchmark: 23 questions, gold answers from an independent script that never imports the agent, and three arms — the model picks the settings, gets them inline, or fetches them from the pack.
- Sandbox isolation: the agent only ever sees the data layers, never the gold answers, rubric or pack files.
03Architecture
04Stack
- Python
- GeoPandas
- Rasterio
- Shapely
- Ollama
- Sentinel-1
- Copernicus DEM
- OpenStreetMap
05What I owned
- The benchmark design: questions, the three arms, the floor check, the pre-committed re-run rule.
- Validation of the gold answers and the radar threshold, including the sensitivity analysis.
- Diagnosis of the failures and the upstream fixes.
AI assistance: Implemented with AI coding agents (Codex, Claude Code) under my direction; decisions, validation and fixes are logged in PROGRESS.md (stated in the repo’s README).
06Verified results
- 39 of 40failed runs were the agent misusing its tools — not missing flood knowledge12 of 52 runs correct overall · one complete run · 23 questionsSource: kerala-flood-gis-agent/README.md · Key findings · read 2026-11-21
- 2 upstream bugs fixedin GISclaw, each with a regression test: empty polygons counted as 1; slope on a geographic DEM gave ~89.95° for a 0.57° rampSource: kerala-flood-gis-agent/REPORT.md · §6 · read 2026-11-21
- 12 / 52 runs correctgpt-oss:20b, one complete run of the 52-run matrixAbout one run per question per arm, so arm differences are not statistically meaningful (p = 1.00).Source: kerala-flood-gis-agent/README.md · Headline results · read 2026-11-21
- 2 / 6 on the floor checkgpt-oss:20b (borderline pass) vs Gemini 3.5 Flash-Lite 1/6, Qwen3.5 9B 0/6, Qwen2.5-Coder 7B 0/6Source: kerala-flood-gis-agent/README.md · Floor check · read 2026-11-21
What these numbers don’t show
- A single complete run, small n, one model. A second run stopped at 35 of 52 when GPU access was lost and is not used anywhere.
- The radar water threshold (−14 dB) was chosen after looking at the histogram; ±1 dB sensitivity is reported.
- The elevation model is a DSM, not a DTM.
07More

08Credits
- Built on GISclaw (open source, AGPL-3.0) — github.com/geumjin99/GISclaw.
- Contains modified Copernicus Sentinel-1 data (2018), via Microsoft Planetary Computer; JRC Global Surface Water (Pekel et al. 2016); Copernicus DEM GLO-30; © OpenStreetMap contributors (ODbL).