{"status":"ok","message-type":"work","message-version":"1.0.0","message":{"indexed":{"date-parts":[[2026,11,20]],"date-time":"2026-11-20T23:36:16Z","timestamp":1795217776465,"version":"4.10.3"},"reference-count":59,"publisher":"MDPI AG","issue":"8","license":[{"start":{"date-parts":[[2025,8,18]],"date-time":"2025-08-18T00:00:00Z","timestamp":1755475200000},"content-version":"vor","delay-in-days":0,"URL":"https:\/\/creativecommons.org\/licenses\/by\/4.0\/"}],"funder":[{"name":"Institute for Society, Culture and Environment (ISCE) at Virginia Tech and OpenAI\u2019s Researcher Access Program"}],"content-domain":{"domain":[],"crossmark-restriction":false},"short-container-title":["IJGI"],"abstract":"<jats:p>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\u2019s GPT-4o-mini model in two forms: an \u201cAs-Is\u201d baseline and a fine-tuned version trained on 600+ prompt\u2013response 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\u2019s 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.<\/jats:p>","DOI":"10.3390\/ijgi14080314","type":"journal-article","created":{"date-parts":[[2025,8,18]],"date-time":"2025-08-18T11:31:37Z","timestamp":1755516697000},"page":"314","update-policy":"https:\/\/doi.org\/10.3390\/mdpi_crossmark_policy","source":"Crossref","is-referenced-by-count":14,"title":["Generative AI for Geospatial Analysis: Fine-Tuning ChatGPT to Convert Natural Language into Python-Based Geospatial Computations"],"prefix":"10.3390","volume":"14","author":[{"given":"Zachary","family":"Sherman","sequence":"first","affiliation":[{"name":"Department of Geography, Virginia Tech, Blacksburg, VA 24060, USA"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"ORCID":"https:\/\/orcid.org\/0000-0002-9572-0427","authenticated-orcid":false,"given":"Sandesh","family":"Sharma Dulal","sequence":"additional","affiliation":[{"name":"Department of Geography, Virginia Tech, Blacksburg, VA 24060, USA"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"ORCID":"https:\/\/orcid.org\/0000-0002-5908-4662","authenticated-orcid":false,"given":"Jin-Hee","family":"Cho","sequence":"additional","affiliation":[{"name":"Department of Computer Science, Virginia Tech Research Center, 900 N Glebe Rd, Arlington, VA 22203, USA"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"given":"Mengxi","family":"Zhang","sequence":"additional","affiliation":[{"name":"Department of Health Systems and Implementation Science, Virginia Tech Carilion School of Medicine, 2 Riverside Circle, Roanoke, VA 24016, USA"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"ORCID":"https:\/\/orcid.org\/0000-0002-7275-769X","authenticated-orcid":false,"given":"Junghwan","family":"Kim","sequence":"additional","affiliation":[{"name":"Department of Geography, Virginia Tech, Blacksburg, VA 24060, USA"}],"role":[{"vocabulary":"crossref","role":"author"}]}],"member":"1968","published-online":{"date-parts":[[2025,8,18]]},"reference":[{"key":"ref_1","doi-asserted-by":"crossref","first-page":"105701","DOI":"10.1016\/j.cities.2025.105701","article-title":"Urban Chatter: Exploring the potential of ChatGPT-like and generative AI in enhancing planning support","volume":"158","author":"Jiang","year":"2025","journal-title":"Cities"},{"key":"ref_2","first-page":"103976","article-title":"GeoGPT: An assistant for understanding and processing geospatial tasks","volume":"131","author":"Zhang","year":"2024","journal-title":"Int. J. Appl. Earth Obs. Geoinf."},{"key":"ref_3","doi-asserted-by":"crossref","unstructured":"Ullah, A., Qi, G., Hussain, S., Ullah, I., and Ali, Z. (2024). The Role of LLMs in Sustainable Smart Cities: Applications, Challenges, and Future Directions. arXiv.","DOI":"10.1007\/s41060-025-00856-2"},{"key":"ref_4","first-page":"1877","article-title":"Language Models are Few-Shot Learners","volume":"33","author":"Brown","year":"2020","journal-title":"Adv. Neural Inf. Process. Syst."},{"key":"ref_5","unstructured":"Fang, C., Miao, N., Srivastav, S., Liu, J., Zhang, R., Fang, R., Tsang, R., Nazari, N., Wang, H., and Homayoun, H. (2024, January 14\u201316). Large Language Models for Code Analysis: Do {LLMs} Really Do Their Job?. Proceedings of the 33rd USENIX Security Symposium (USENIX Security 24), Philadelphia, PA, USA."},{"key":"ref_6","doi-asserted-by":"crossref","unstructured":"Akinboyewa, T., Li, Z., Ning, H., and Lessani, M.N. (2024). GIS copilot: Towards an autonomous GIS agent for spatial analysis. arXiv.","DOI":"10.1080\/17538947.2025.2497489"},{"key":"ref_7","doi-asserted-by":"crossref","first-page":"103808","DOI":"10.1016\/j.ipm.2024.103808","article-title":"BB-GeoGPT: A framework for learning a large language model for geographic information science","volume":"61","author":"Zhang","year":"2024","journal-title":"Inf. Process. Manag."},{"key":"ref_8","doi-asserted-by":"crossref","first-page":"2219","DOI":"10.1111\/tgis.13233","article-title":"Correctness Comparison of ChatGPT-4, Gemini, Claude-3, and Copilot for Spatial Tasks","volume":"28","author":"Hochmair","year":"2024","journal-title":"Trans. GIS"},{"key":"ref_9","doi-asserted-by":"crossref","unstructured":"Mooney, P., Cui, W., Guan, B., and Juh\u00e1sz, L. (2023, January 13). Towards Understanding the Geospatial Skills of ChatGPT: Taking a Geographic Information Systems (GIS) Exam. Proceedings of the 6th ACM SIGSPATIAL International Workshop on AI for Geographic Knowledge Discover, Hamburg, Germany.","DOI":"10.31223\/X5P38P"},{"key":"ref_10","doi-asserted-by":"crossref","unstructured":"Mahmoudi, H., Camboim, S., and Brovelli, M.A. (2023). Development of a Voice Virtual Assistant for the Geospatial Data Visualization Application on the Web. ISPRS Int. J. Geo-Inf., 12.","DOI":"10.20944\/preprints202307.0413.v1"},{"key":"ref_11","doi-asserted-by":"crossref","unstructured":"Morocho, V., Achig, R., Bustamante, J., and Mendieta, F. (2022, January 11\u201314). Virtual Assistants to Bring Geospatial Information Closer to a Smart Citizen. Proceedings of the 2022 IEEE Sixth Ecuador Technical Chapters Meeting (ETCM), Quito, Ecuador.","DOI":"10.1109\/ETCM56276.2022.9935761"},{"key":"ref_12","doi-asserted-by":"crossref","first-page":"2353122","DOI":"10.1080\/17538947.2024.2353122","article-title":"GPT, Large Language Models (LLMs) and Generative Artificial Intelligence (GAI) Models in Geospatial Science: A Systematic Review","volume":"17","author":"Wang","year":"2024","journal-title":"Int. J. Digit. Earth"},{"key":"ref_13","doi-asserted-by":"crossref","first-page":"102085","DOI":"10.1016\/j.tele.2023.102085","article-title":"Exploring the limitations in how ChatGPT introduces environmental justice issues in the United States: A case study of 3108 counties","volume":"86","author":"Kim","year":"2024","journal-title":"Telemat. Inform."},{"key":"ref_14","doi-asserted-by":"crossref","first-page":"12","DOI":"10.1007\/s43762-024-00123-3","article-title":"Automated floodwater depth estimation using large multimodal model for rapid flood mapping","volume":"4","author":"Akinboyewa","year":"2024","journal-title":"Comput. Urban Sci."},{"key":"ref_15","doi-asserted-by":"crossref","first-page":"84","DOI":"10.1080\/00330124.2024.2404894","article-title":"Multimodal Large Language Models as Built Environment Auditing Tools","volume":"77","author":"Jang","year":"2025","journal-title":"Prof. Geogr."},{"key":"ref_16","doi-asserted-by":"crossref","unstructured":"Jiang, Y., and Yang, C. (2024). Is ChatGPT a Good Geospatial Data Analyst? Exploring the Integration of Natural Language into Structured Query Language within a Spatial Database. ISPRS Int. J. Geo Inf., 13.","DOI":"10.3390\/ijgi13010026"},{"key":"ref_17","doi-asserted-by":"crossref","unstructured":"Mansourian, A., and Oucheikh, R. (2024). ChatGeoAI: Enabling Geospatial Analysis for Public through Natural Language, with Large Language Models. ISPRS Int. J. Geo Inf., 13.","DOI":"10.3390\/ijgi13100348"},{"key":"ref_18","doi-asserted-by":"crossref","first-page":"2458688","DOI":"10.1080\/17538947.2025.2458688","article-title":"An autonomous GIS agent framework for geospatial data retrieval","volume":"18","author":"Ning","year":"2025","journal-title":"Int. J. Digit. Earth"},{"key":"ref_19","doi-asserted-by":"crossref","first-page":"186","DOI":"10.1080\/00330124.2024.2434455","article-title":"Comparing the Spatial Querying Capacity of Large Language Models: OpenAI\u2019s ChatGPT and Google\u2019s Gemini Pro","volume":"77","author":"Renshaw","year":"2025","journal-title":"Prof. Geogr."},{"key":"ref_20","doi-asserted-by":"crossref","first-page":"717","DOI":"10.1080\/15230406.2024.2404868","article-title":"MapGPT: An Autonomous Framework for Mapping by Integrating Large Language Model and Cartographic Tools","volume":"51","author":"Zhang","year":"2024","journal-title":"Cartogr. Geogr. Inf. Sci."},{"key":"ref_21","doi-asserted-by":"crossref","unstructured":"Zhang, M., He, J., Lei, S., Yue, M., Wang, L., and Lu, C.-T. (2024, January 14\u201319). Can LLM Find the Green Circle? Investigation and Human-Guided Tool Manipulation for Compositional Generalization. Proceedings of the ICASSP 2024\u20142024 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), Seoul, Republic of Korea.","DOI":"10.1109\/ICASSP48485.2024.10446355"},{"key":"ref_22","doi-asserted-by":"crossref","unstructured":"Tao, R., and Xu, J. (2023). Mapping with ChatGPT. ISPRS Int. J. Geo Inf., 12.","DOI":"10.3390\/ijgi12070284"},{"key":"ref_23","doi-asserted-by":"crossref","first-page":"4668","DOI":"10.1080\/17538947.2023.2278895","article-title":"Autonomous GIS: The next-generation AI-powered GIS","volume":"16","author":"Li","year":"2023","journal-title":"Int. J. Digit. Earth"},{"key":"ref_24","doi-asserted-by":"crossref","first-page":"707","DOI":"10.1080\/13658816.2024.2438937","article-title":"GeoTool-GPT: A Trainable Method for Facilitating Large Language Models to Master GIS Tools","volume":"39","author":"Wei","year":"2025","journal-title":"Int. J. Geogr. Inf. Sci."},{"key":"ref_25","doi-asserted-by":"crossref","first-page":"104429","DOI":"10.1016\/j.tra.2025.104429","article-title":"Impacts of Point of Interest (POI) Data Selection on 15-Minute City (15-MC) Accessibility Scores and Inequality Assessments","volume":"195","author":"Rahman","year":"2025","journal-title":"Transp. Res. Part A Policy Pract."},{"key":"ref_26","doi-asserted-by":"crossref","first-page":"117","DOI":"10.1111\/cdoe.13015","article-title":"Navigating Disparities in Dental Health-A Transit-Based Investigation of Access to Dental Care in Virginia","volume":"53","author":"Kim","year":"2025","journal-title":"Community Dent. Oral Epidemiol."},{"key":"ref_27","doi-asserted-by":"crossref","first-page":"103392","DOI":"10.1016\/j.apgeog.2024.103392","article-title":"Spatial intelligence and contextual relevance in AI-driven health information retrieval","volume":"171","author":"Yiannakoulias","year":"2024","journal-title":"Appl. Geogr."},{"key":"ref_28","doi-asserted-by":"crossref","first-page":"101356","DOI":"10.1016\/j.xcrm.2023.101356","article-title":"Artificial intelligence, ChatGPT, and other large language models for social determinants of health: Current state and future directions","volume":"5","author":"Ong","year":"2024","journal-title":"Cell Rep. Med."},{"key":"ref_29","unstructured":"OpenAI (2025, July 02). Advancing Cost-Efficient Intelligence. Available online: https:\/\/openai.com\/index\/gpt-4o-mini-advancing-cost-efficient-intelligence\/."},{"key":"ref_30","unstructured":"OpenAI (2025, July 02). Fine-Tuning Guide. Available online: https:\/\/platform.openai.com\/docs\/guides\/fine-tuning."},{"key":"ref_31","unstructured":"Gramacki, P., Martins, B., and Szyma\u0144ski, P. (November, January 29). Evaluation of Code LLMs on Geospatial Code Generation. Proceedings of the Proceedings of the 7th ACM SIGSPATIAL International Workshop on AI for Geographic Knowledge Discovery, Atlanta, GA, USA."},{"key":"ref_32","doi-asserted-by":"crossref","unstructured":"Hou, S., Shen, Z., Zhao, A., Liang, J., Gui, Z., Guan, X., Li, R., and Wu, H. (2024). GeoCode-GPT: A Large Language Model for Geospatial Code Generation Tasks. arXiv.","DOI":"10.1016\/j.jag.2025.104456"},{"key":"ref_33","doi-asserted-by":"crossref","unstructured":"Hou, S., Jiao, H., Shen, Z., Liang, J., Zhao, A., Zhang, X., Wang, J., and Wu, H. (2024). Chain-of-Programming (CoP): Empowering Large Language Models for Geospatial Code Generation. arXiv.","DOI":"10.1080\/17538947.2025.2509812"},{"key":"ref_34","doi-asserted-by":"crossref","unstructured":"Ikumapayi, N. (2023). Automated Front-End Code Generation Using OpenAI: Empowering Web Development Efficiency. SSRN Electron. J., 4590704.","DOI":"10.2139\/ssrn.4590704"},{"key":"ref_35","unstructured":"Gupta, D.V., Ishaqui, A.S.A., and Kadiyala, D.K. (2024). Geode: A Zero-shot Geospatial Question-Answering Agent with Explicit Reasoning and Precise Spatio-Temporal Retrieval. arXiv."},{"key":"ref_36","unstructured":"Dai, H., Li, Y., Liu, Z., Zhao, L., Wu, Z., Song, S., Shen, Y., Zhu, D., Li, X., and Li, S. (2023). Ad-Autogpt: An Autonomous Gpt for Alzheimer\u2019s Disease Infodemiology. arXiv."},{"key":"ref_37","doi-asserted-by":"crossref","unstructured":"Xu, L., Zhao, S., Lin, Q., Chen, L., Luo, Q., Wu, S., Ye, X., Feng, H., and Du, Z. (2024). Evaluating Large Language Models on Spatial Tasks: A Multi-Task Benchmarking Study. arXiv.","DOI":"10.1080\/17538947.2025.2480268"},{"key":"ref_38","unstructured":"Gupta, S., Nandwani, Y., Yehudai, A., Mishra, M., Pandey, G., Raghu, D., and Joshi, S. (2024). Selective Self-Rehearsal: A Fine-Tuning Approach to Improve Generalization in Large Language Models. arXiv."},{"key":"ref_39","doi-asserted-by":"crossref","unstructured":"Plewe, B., Dibiase, D., Demers, M., Johnson, A., Kemp, K., and Wentz, E. (2006). Geographic Information Science & Technology Body of Knowledge, University Consortium for Geographic Information Science.","DOI":"10.1559\/152304007781002253"},{"key":"ref_40","unstructured":"Engine, A.G. (2025, July 02). Nearest Neighbors. Available online: https:\/\/developers.arcgis.com\/geoanalytics\/tools\/nearest-neighbors."},{"key":"ref_41","doi-asserted-by":"crossref","unstructured":"Masis, T., and O\u2019Connor, B. (2024). Where on earth do users say they are?: Geo-entity linking for noisy multilingual user input. arXiv.","DOI":"10.18653\/v1\/2024.nlpcss-1.7"},{"key":"ref_42","doi-asserted-by":"crossref","unstructured":"Bell, S., Marlow, T., Wombacher, K., Hitt, A., Parikh, N., Zsom, A., and Frickel, S. (2020). Automated Data Extraction from Historical City Directories: The Rise and Fall of Mid-Century Gas Stations in Providence, RI. PLoS ONE, 15.","DOI":"10.1371\/journal.pone.0220219"},{"key":"ref_43","unstructured":"Martynov, N., Baushenko, M., Kozlova, A., Kolomeytseva, K., Abramov, A., and Fenogenova, A. (2023). A methodology for generative spelling correction via natural spelling errors emulation across multiple domains and languages. arXiv."},{"key":"ref_44","doi-asserted-by":"crossref","first-page":"88","DOI":"10.4258\/hir.2012.18.2.88","article-title":"Geographical Information Systems and Health: Current State and Future Directions","volume":"18","author":"Shaw","year":"2012","journal-title":"Healthc. Inform. Res."},{"key":"ref_45","unstructured":"(2025, July 02). Fuzzywuzzy: Fuzzy String Matching in Python. Available online: https:\/\/github.com\/seatgeek\/fuzzywuzzy."},{"key":"ref_46","doi-asserted-by":"crossref","unstructured":"Lee, S., Jang, S., Jang, S., Lee, D., and Yu, H. (2024). Exploring Language Model\u2019s Code Generation Ability with Auxiliary Functions. arXiv.","DOI":"10.18653\/v1\/2024.findings-naacl.181"},{"key":"ref_47","doi-asserted-by":"crossref","unstructured":"Han, Y., Liu, J., Luo, A., Wang, Y., and Bao, S. (2025). Fine-Tuning LLM-Assisted Chinese Disaster Geospatial Intelligence Extraction and Case Studies. ISPRS Int. J. Geo Inf., 14.","DOI":"10.3390\/ijgi14020079"},{"key":"ref_48","unstructured":"Devlin, J., Chang, M.-W., Lee, K., and Toutanova, K. (2019, January 2\u20137). Bert: Pre-Training of Deep Bidirectional Transformers for Language UNDERSTANDING. Proceedings of the 2019 conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Minneapolis, MN, USA."},{"key":"ref_49","unstructured":"Manvi, R., Khanna, S., Mai, G., Burke, M., Lobell, D., and Ermon, S. (2023). Geollm: Extracting geospatial knowledge from large language models. arXiv."},{"key":"ref_50","unstructured":"(2025, July 02). Frontier AI LLMs, Assistants, Agents, Services | Mistral AI. Available online: https:\/\/mistral.ai\/."},{"key":"ref_51","unstructured":"(2025, July 02). Deepseek. Available online: https:\/\/deep-seek.chat."},{"key":"ref_52","unstructured":"Lin, Q., Hu, R., Li, H., Wu, S., Li, Y., Fang, K., Feng, H., Du, Z., and Xu, L. (2024). ShapefileGPT: A Multi-Agent Large Language Model Framework for Automated Shapefile Processing. arXiv."},{"key":"ref_53","unstructured":"(2025, July 02). Openrouteservice. Available online: https:\/\/openrouteservice.org\/."},{"key":"ref_54","unstructured":"(2025, July 02). Nominatim. Available online: https:\/\/nominatim.org\/."},{"key":"ref_55","doi-asserted-by":"crossref","unstructured":"Jing, C., Du, M., Li, S., and Liu, S. (2019). Geospatial Dashboards for Monitoring Smart City Performance. Sustainability, 11.","DOI":"10.3390\/su11205648"},{"key":"ref_56","doi-asserted-by":"crossref","first-page":"151","DOI":"10.5194\/isprs-archives-XLVIII-4-W5-2022-151-2022","article-title":"Building Community Resilience Through Geospatial Information Dashboards","volume":"XLVIII-4\/W5-2022","author":"Praharaj","year":"2022","journal-title":"Int. Arch. Photogramm. Remote Sens. Spat. Inf. Sci."},{"key":"ref_57","doi-asserted-by":"crossref","unstructured":"Lwin, K.K., Sekimoto, Y., Takeuchi, W., and Zettsu, K. (2019, January 18\u201320). City Geospatial Dashboard: IoT and Big Data Analytics for Geospatial Solutions Provider in Disaster Management. Proceedings of the 2019 International Conference on Information and Communication Technologies for Disaster Management (ICT-DM), Paris, France.","DOI":"10.1109\/ICT-DM47966.2019.9032921"},{"key":"ref_58","doi-asserted-by":"crossref","first-page":"1","DOI":"10.1145\/3672459","article-title":"Self-Collaboration Code Generation via ChatGPT","volume":"33","author":"Dong","year":"2024","journal-title":"ACM Trans. Softw. Eng. Methodol."},{"key":"ref_59","doi-asserted-by":"crossref","unstructured":"Bernh\u00e4userov\u00e1, V., Kraj\u0148\u00e1kov\u00e1, L., H\u00e1tlov\u00e1, K., and Hanus, M. (2022). The Limits of GIS Implementation in Education: A Systematic Review. ISPRS Int. J. Geo Inf., 11.","DOI":"10.3390\/ijgi11120592"}],"container-title":["ISPRS International Journal of Geo-Information"],"original-title":[],"language":"en","link":[{"URL":"https:\/\/www.mdpi.com\/2220-9964\/14\/8\/314\/pdf","content-type":"unspecified","content-version":"vor","intended-application":"similarity-checking"}],"deposited":{"date-parts":[[2025,10,9]],"date-time":"2025-10-09T18:29:48Z","timestamp":1760034588000},"score":1,"resource":{"primary":{"URL":"https:\/\/www.mdpi.com\/2220-9964\/14\/8\/314"}},"subtitle":[],"short-title":[],"issued":{"date-parts":[[2025,8,18]]},"references-count":59,"journal-issue":{"issue":"8","published-online":{"date-parts":[[2025,8]]}},"alternative-id":["ijgi14080314"],"URL":"https:\/\/doi.org\/10.3390\/ijgi14080314","relation":{},"ISSN":["2220-9964"],"issn-type":[{"value":"2220-9964","type":"electronic"}],"subject":[],"published":{"date-parts":[[2025,8,18]]}}}