GeoContra: From Fluent GIS Code to Verifiable Spatial Analysis with Geography-Grounded Repair

📅 2026-05-01
📈 Citations: 0
Influential: 0
📄 PDF

career value

164K/year
🤖 AI Summary
Current large language models often generate GIS code that violates spatial rules—such as geographic semantics, topological relationships, coordinate reference systems (CRS), and units—leading to unreliable outputs. This work proposes GeoContra, a novel framework that formalizes geographic constraints into executable geographic contracts and integrates static checking, runtime verification, and semantic validation to establish a geography-aware, closed-loop repair mechanism. By embedding natural language understanding, CRS metadata, spatial predicates, and topological rules directly into the LLM generation pipeline, GeoContra significantly enhances spatial correctness across 7,079 real-world tasks: achieving up to 81.5% accuracy with proprietary models and yielding an average improvement of 26.6% across eleven open-source models.
📝 Abstract
Reliable spatial analysis in GIScience requires preserving coordinate semantics, topology, units, and geographic plausibility. Current LLM-based GIS systems generate fluent scripts but rarely enforce these geographic rules at scale. We present GeoContra, a verification and repair framework for LLM-driven Python GIS workflows. It represents each task as an executable geospatial contract-including natural-language questions, schemas, CRS metadata, expected outputs, spatial predicates, topology, metrics, required operations, and forbidden shortcuts. Generated programs undergo static rule inspection, runtime validation, and semantic verification, with violations fed back into a bounded repair loop. Evaluated on 7,079 real geospatial tasks across 15 Boston-area zones, 9 task families, and 11 open-source models (600 runs each), GeoContra improves spatial correctness on closed models from 47.6% to 77.5% for DeepSeek-V4 and from 57.7% to 81.5% for Kimi-K2.5. Across 11 open models, average correctness rises by 26.6%. GeoContra turns fluent code production into verifiable spatial analysis, catching negative travel times, CRS/field-schema violations, missing predicates, and brittle output casts that otherwise yield executable but geographically invalid results.
Problem

Research questions and friction points this paper is trying to address.

geospatial analysis
geographic plausibility
coordinate semantics
topology
GIS
Innovation

Methods, ideas, or system contributions that make the work stand out.

geospatial contract
LLM verification
geographic plausibility
topology-aware repair
CRS validation
🔎 Similar Papers
No similar papers found.