LLM-based Text-to-SQL: A Case Study of Geospatial Information Retrieval

Temitayo Olamilekan Ogunsusi, Jose Angel Nguema Azeme Mangue, Weishan Bai, Xinyue Ye, Lijun Qian, Xishuang Dong

Temitayo Olamilekan Ogunsusi et al., 2026 IEEE 20th International Conference on Semantic Computing (ICSC), 2026 | | https://doi.org/10.1109/icsc67292.2026.00075


Abstract

Text-to-SQL aims to convert natural language questions into executable SQL queries for retrieving information from relational databases. However, geospatial databases present unique challenges due to complex spatial data types, coordinate reference systems, and geometric predicate functions. In this paper, we present a comprehensive case study evaluating Large Language Model (LLM)-based Text-to-SQL frameworks for geospatial information retrieval. We design specialized schema-linking, in-context prompt engineering, and iterative syntax-correction mechanisms to bridge natural language spatial queries and PostGIS dialect requirements. Extensive evaluations show that the proposed methodology significantly improves query generation accuracy and schema comprehension in geospatial decision-support systems.