An Automated Framework for Natural Language-Based Spatial Query Using Large Language Models

Automating spatial analysis remains challenging due to its dependence on predefined workflows, static schemas, and expert-driven configurations, which limit adaptability across diverse datasets and analytical contexts. Recent advances in large language models (LLMs) provide new opportunities to address these challenges by enabling systems to interpret human intent, reason over structured data, and generate executable analytical workflows. This study presents an automated Spatial Query and Analysis (SQA) framework that leverages LLMs to translate natural language queries into validated spatial operations. The framework interprets user prompts and classifies them as either general or spatial queries. General queries are answered directly by a language model, whereas spatial queries are processed through a multi-agent reasoning pipeline that performs semantic interpretation, spatial analysis, peer-review validation, and code execution checks to ensure accuracy and consistency. In addition to query-based interaction, users can upload new spatial datasets that are automatically validated and integrated into the system through dynamic knowledge augmentation. Evaluation using a large metropolitan university campus dataset shows that SQA framework achieves improved spatial reasoning performance compared with single-agent baselines, including configurations with metadata access and error-correction mechanisms. The framework also incorporates a two-step error recovery process that successfully resolves common failure types, including table or schema mismatches, coordinate reference system (CRS) misuse, and column or spatial reasoning errors. SQA framework demonstrates consistent accuracy across single-table, multi-table, and 3D queries, producing integrated outputs in map, chart, and tabular formats.

Authors

Institutions

Publication Details

Journal
Journal of Geovisualization and Spatial Analysis
Published
2026-04-27
DOI
https://doi.org/10.1007/s41651-026-00260-9
Primary Topic
Geographic Information Systems Studies
Type
article
Field-Weighted Citation Impact
0.00

Funders

Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

An Automated Framework for Natural Language-Based Spatial Query Using Large Language Models

Mazdak Ghasemi Tootkaboni, Abbas Rajabifard, Alice Kesminas, Yiqun Chen et al.
Journal of Geovisualization and Spatial Analysis
Geographic Information Systems Studies
article

An Automated Framework for Natural Language-Based Spatial Query Using Large Language Models

Mazdak Ghasemi Tootkaboni, Abbas Rajabifard, Alice Kesminas, Yiqun Chen, Ensiyeh Javaherian Pour
article en

Abstract

Automating spatial analysis remains challenging due to its dependence on predefined workflows, static schemas, and expert-driven configurations, which limit adaptability across diverse datasets and analytical contexts. Recent advances in large language models (LLMs) provide new opportunities to address these challenges by enabling systems to interpret human intent, reason over structured data, and generate executable analytical workflows. This study presents an automated Spatial Query and Analysis (SQA) framework that leverages LLMs to translate natural language queries into validated spatial operations. The framework interprets user prompts and classifies them as either general or spatial queries. General queries are answered directly by a language model, whereas spatial queries are processed through a multi-agent reasoning pipeline that performs semantic interpretation, spatial analysis, peer-review validation, and code execution checks to ensure accuracy and consistency. In addition to query-based interaction, users can upload new spatial datasets that are automatically validated and integrated into the system through dynamic knowledge augmentation. Evaluation using a large metropolitan university campus dataset shows that SQA framework achieves improved spatial reasoning performance compared with single-agent baselines, including configurations with metadata access and error-correction mechanisms. The framework also incorporates a two-step error recovery process that successfully resolves common failure types, including table or schema mismatches, coordinate reference system (CRS) misuse, and column or spatial reasoning errors. SQA framework demonstrates consistent accuracy across single-table, multi-table, and 3D queries, producing integrated outputs in map, chart, and tabular formats.

Journal of Geovisualization and Spatial AnalysisVol. 10(1)
CRC for Spatial information (AU)
University of Melbourne
Quality Education
Openalex Percentile: Top 3%
Geographic Information Systems Studies
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.