Content area

Abstract

What are the main findings?

Fine-tuning GPT-4o-mini on geospatial queries significantly improves Python code generation for spatial analysis tasks

The fine-tuned model achieved an 89.7% accuracy rate, improving 49.2 percentage points over the baseline.

What is the implication of the main finding?

Integrating LLMs into geospatial dashboards enables real-time, user-friendly analysis for smart city management.

This framework offers scalable potential for domain-specific AI tools in geospatial science and smart urban analytics.

This study investigates the potential of fine-tuned large language models (LLMs) to enhance geospatial intelligence by translating natural language queries into executable Python code. Traditional GIS workflows, while effective, often lack usability and scalability for non-technical users. LLMs offer a new approach by enabling conversational interaction with spatial data. We evaluate OpenAI’s GPT-4o-mini model in two forms: an “As-Is” baseline and a fine-tuned version trained on 600+ prompt–response pairs related to geospatial Python scripting in Virginia. Using U.S. Census shapefiles and hospital data, we tested both models across six types of spatial queries. The fine-tuned model achieved 89.7%, a 49.2 percentage point improvement over the baseline’s 40.5%. It also demonstrated substantial reductions in execution errors and token usage. Key innovations include the integration of spatial reasoning, modular external function calls, and fuzzy geographic input correction. These findings suggest that fine-tuned LLMs can improve the accuracy, efficiency, and usability of geospatial dashboards when they are powered by LLMs. Our results further imply a scalable and replicable approach for future domain-specific AI applications in geospatial science and smart cities studies.

Details

1009240
Company / organization
Title
Generative AI for Geospatial Analysis: Fine-Tuning ChatGPT to Convert Natural Language into Python-Based Geospatial Computations
Author
Sherman, Zachary 1 ; Sharma, Dulal Sandesh 1   VIAFID ORCID Logo  ; Jin-Hee, Cho 2   VIAFID ORCID Logo  ; Zhang Mengxi 3 ; Kim, Junghwan 1   VIAFID ORCID Logo 

 Department of Geography, Virginia Tech, Blacksburg, VA 24060, USA; [email protected] (Z.S.); [email protected] (S.S.D.) 
 Department of Computer Science, Virginia Tech Research Center, 900 N Glebe Rd, Arlington, VA 22203, USA; [email protected] 
 Department of Health Systems and Implementation Science, Virginia Tech Carilion School of Medicine, 2 Riverside Circle, Roanoke, VA 24016, USA; [email protected] 
Volume
14
Issue
8
First page
314
Number of pages
22
Publication year
2025
Publication date
2025
Publisher
MDPI AG
Place of publication
Basel
Country of publication
Switzerland
Publication subject
e-ISSN
22209964
Source type
Scholarly Journal
Language of publication
English
Document type
Journal Article
Publication history
 
 
Online publication date
2025-08-18
Milestone dates
2025-04-13 (Received); 2025-08-14 (Accepted)
Publication history
 
 
   First posting date
18 Aug 2025
ProQuest document ID
3244039892
Document URL
https://www.proquest.com/scholarly-journals/generative-ai-geospatial-analysis-fine-tuning/docview/3244039892/se-2?accountid=208611
Copyright
© 2025 by the authors. Published by MDPI on behalf of the International Society for Photogrammetry and Remote Sensing. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/). Notwithstanding the ProQuest Terms and Conditions, you may use this content in accordance with the terms of the License.
Last updated
2026-01-16
Database
2 databases
  • Coronavirus Research Database
  • ProQuest One Academic