Generative AI for Geospatial Analysis: Fine-Tuning ChatGPT to Convert Natural Language into Python-Based Geospatial Computations.

Saved in:
Bibliographic Details
Title: Generative AI for Geospatial Analysis: Fine-Tuning ChatGPT to Convert Natural Language into Python-Based Geospatial Computations.
Authors: Sherman, Zachary, Sharma Dulal, Sandesh, Cho, Jin-Hee, Zhang, Mengxi, Kim, Junghwan
Source: ISPRS International Journal of Geo-Information; Aug2025, Vol. 14 Issue 8, p314, 21p
Subject Terms: GEOSPATIAL data, LANGUAGE models, PYTHON programming language, GENERATIVE artificial intelligence, GEODATABASES, CHATGPT, SMART cities
Company/Entity: OPENAI Inc.
Abstract: Highlights: 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. [ABSTRACT FROM AUTHOR]
Copyright of ISPRS International Journal of Geo-Information is the property of MDPI and its content may not be copied or emailed to multiple sites without the copyright holder's express written permission. Additionally, content may not be used with any artificial intelligence tools or machine learning technologies. However, users may print, download, or email articles for individual use. This abstract may be abridged. No warranty is given about the accuracy of the copy. Users should refer to the original published version of the material for the full abstract. (Copyright applies to all Abstracts.)
Database: Complementary Index
Description
Abstract:Highlights: 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. [ABSTRACT FROM AUTHOR]
ISSN:22209964
DOI:10.3390/ijgi14080314