GeoIR-Compiler: A Geospatial Intermediate Representation and Compilation Framework for Chinese Urban Spatial Question Answering
Abstract
Natural-language access to spatial databases requires relation interpretation, entity grounding, metric normalization, and database-specific execution semantics. Direct generation of Structured Query Language (SQL) by large language models (LLMs) can therefore return executable but spatially wrong SQL, especially for Chinese urban questions with aliases, abbreviated place names, and geometry-dependent predicates. This paper presents GeoIR-Compiler, a spatially specialized framework that maps a Chinese question to a typed geospatial intermediate representation (GeoIR), grounds mentions and attributes to database objects, and deterministically compiles the grounded representation into SQL for PostGIS, a spatial database extension for PostgreSQL. The contribution is the specialization of intermediate representations for Chinese urban spatial question answering through explicit spatial relations, metric constraints, grounding records, and PostGIS execution templates. We construct two controlled executable benchmarks, NJ-GeoIR-700 and WH-GeoIR-700, covering retrieval, topology, distance, nearest-neighbor, aggregation, compositional, and alias/noisy-mention queries. Across seven locally served backbones, GeoIR-Full reaches mean execution accuracies of 0.7271 on Nanjing and 0.7363 on Wuhan, outperforming Direct-SQL, Data-Augmented In-Context Learning (DAIL)-SQL-style, and Linking-SQL under the fixed evaluation protocol. Ablations are consistent with grounding contributing strongly to the observed gains, while verification mainly trades coverage for answer reliability.
Fields of Study & Subjects
Geographic Information Systems Studies
Constraint Satisfaction and Optimization
Human Mobility and Location-Based Analysis
Publication details
- Journal / source
- ISPRS International Journal of Geo-Information
- Publisher
- MDPI AG
- Volume
- 15
- Issue
- 7
- Pages
- 310–310
- Publication date
- 8 July 2026
- Language
- EN