Abstract
This study investigates the spatial reasoning capabilities of Large Language Models (LLMs) by evaluating their ability to process vector geometries represented as Well-Known Text (WKT). By testing models such as GPT-4 and DeepSeek-R1 on tasks ranging from topological classification to translating vernacular language into formal GIS predicates, the research identifies a significant "semantic-physical gap." While LLMs demonstrate a surprising ability to extract geometric meaning from text—achieving accuracies up to 0.66—they remain less reliable than traditional geometric engines for complex, coordinate-based logic.
Introduction
Artificial Intelligence currently faces a "semantic-physical gap." While LLMs excel at natural language processing, they often struggle with the precise, coordinate-based requirements of Geographic Information Systems (GIS). Traditional GIS tools utilize rigorous mathematical models, such as the Dimensionally Extended 9-Intersection Model (DE-9IM), to determine spatial relationships. This research explores whether geometry can be treated as a language, passing raw WKT coordinates (e.g., POLYGON((...))) to LLMs to perform spatial reasoning. This inquiry is a foundational step toward developing "Geo-Foundation Models" capable of serving as conversational GIS analysts.
Methodology
The researchers developed a comprehensive workflow to evaluate LLMs across three distinct geospatial tasks:
- Topological Relation Qualification: Classifying the relationship between two WKT geometries (e.g., equals, disjoint, touches, contains).
- Spatial Query Processing: Identifying or generating a subject geometry that fits a specific query object and relation.
- Vernacular Translation: Converting informal descriptions (e.g., "Place A is home to Place B") into formal topological predicates.
The study compared two technical approaches: an embedding-based method, where WKT strings are converted into vectors for a Random Forest classifier, and a prompt engineering-based method, utilizing Zero-shot, Few-shot, and Chain-of-Thought (CoT) prompting. The evaluation included GPT-3.5-turbo, GPT-4, and the open-weights DeepSeek-R1-14B.
Datasets
The evaluation utilized real-world multi-sourced geospatial data from Madison, Wisconsin, including road networks (OpenStreetMap), land parcels, and census block groups. Additionally, a DBpedia/Wikipedia dataset consisting of 1,078 unique triplets of place names and natural language descriptions was used to test vernacular translation.
Key Insights and Ideas
- WKT as a "Spatial Language": LLMs can extract geometric meaning from raw coordinate strings, effectively treating WKT as a specialized dialect.
- The Failure of Chain-of-Thought (CoT): Contrary to many LLM tasks, "thinking step-by-step" often decreased accuracy in spatial reasoning. A single cascading error in an intermediate geometric calculation leads to an incorrect final classification.
- Reasoning Asymmetry: Models find it easier to generate a Polygon that contains a Point than to generate a Point within a Polygon, suggesting a reliance on superficial coordinate patterns rather than a holistic mental map.
- Conceptual Neighborhoods: Errors are not random; LLMs often confuse relations that are "topologically close," such as confusing "touches" with "within."
Key Results
GPT-4 with few-shot prompting achieved the highest accuracy of 0.66 in identifying topological relations. Interestingly, the embedding-based approach performed remarkably well (~0.63 accuracy), suggesting that LLM encoders capture significant spatial structure even without explicit reasoning. Furthermore, newer models like DeepSeek-R1-14B outperformed GPT-3.5 in zero-shot reasoning, indicating that reasoning-optimized models are closing the gap with larger proprietary systems.
Conclusion and Future Work
While LLMs show promise, hurdles remain regarding scale, complexity, and the inherent vagueness of natural language. The authors suggest that the future of geospatial AI lies in neurosymbolic approaches or Retrieval-Augmented Generation (RAG), where the LLM acts as a natural language interface that generates code or queries for formal, high-precision GIS engines to execute.
Summary updated