arrow
Return

Chain-of-programming (CoP): empowering large language models for geospatial code generation task

delete2025-05-27
delete0
delete
OA
AI
S
Shuyang Hou *
H
Haoyue Jiao *
Z
Zhangxiao Shen
J
Jianyuan Liang *
A
Anqi Zhao
X
X. Zhang
王建勋 (Jianxun Wang) *
H
Huayi Wu *
DOI:10.1080/17538947.2025.2509812delete
deleteOriginal
deleteOriginal request for help
deleteShare
deleteSave
Abstract

Abstract

En 中文
Large Language Models (LLMs) have driven the development of geospatial code generation but face challenges such as incomplete user requirements and insufficient knowledge of platform-specific syntax, often leading to 'code hallucination.' To address this issue, this paper proposes the Chain-of-Programming (CoP) framework, which divides the generation process into five steps: requirement analysis, algorithm design, code implementation, debugging, and annotation. The framework incorporates a shared information pool, knowledge base retrieval, and user feedback mechanisms, enabling end-to-end code generation without the need for model fine-tuning. Based on geospatial problem classification and evaluation benchmarks, CoP significantly improves the logical clarity, syntactical correctness, and executability of the generated code, achieving performance improvements ranging from 3.0% to 48.8%. Comparative and ablation experiments further validate the advantages of CoP and the necessity of its core components. Case studies on building visualization and fire data analysis demonstrate the practical value of the framework. This study also develops and open-sources a prototype system, offering a systematic, step-by-step solution for LLM-based geospatial code generation and providing valuable insights for code generation in other specialized domains.
Keywords:
Geospatial code generation
Large language models
Code hallucination
Geographic information science
Google earth engine

Journal

International Journal of Digital Earth cover
International Journal of Digital Earth
IF:
4.9
Papers:
1.9K
Citations:
4.7K

Organization

W
wuhan university
Scholars:
8.1W
Papers: 5.8W
Citations: 70