GEE-OPs: an operator knowledge base for geospatial code generation on the Google Earth Engine platform powered by large language models - Shuyang Hou; Jianyuan Liang; Anqi Zhao; Huayi Wu (Geo-spatial Information Science)
As spatiotemporal data grows in complexity, utilizing geospatial modeling on the Google Earth Engine (GEE) platform poses challenges in improving coding efficiency for experts and enhancing the coding capabilities of interdisciplinary users. To address these challenges, we propose a framework for constructing a geospatial operator knowledge base tailored to the GEE JavaScript API. The framework includes an operator syntax knowledge table, an operator relationship frequency knowledge table, an operator frequent pattern knowledge table, and an operator relationship chain knowledge table. Leveraging Abstract Syntax Tree (AST) techniques and frequent itemset mining, we extract operator knowledge from 295,943 real GEE scripts and syntax documentation, forming a structured knowledge base. Experimental results demonstrate that the proposed framework achieves an accuracy ranging from 87% to 93% in operator relationship extraction tasks, measured by accuracy, recall, and F1 score metrics. In operator relationship chain extraction tasks, the framework achieves a performance range of 0.79 to 0.89 across LCS, Ngram, Siamese, and BERT-based evaluations. In geospatial code generation tasks, GEE-OPs improves the executability of mainstream Large Language Models (LLMs) by 38.0% to 44.9%, enhances correctness by 24.1% to 47.2%, and boosts readability by 4.7% to 7.6%. Ablation experiments further validate the essential role of each knowledge table in enhancing model performance. Additionally, key performance indicators – including response time, lines of code, token consumption, and memory usage – are documented to assist readers in replicating the experiments and gaining deeper insights into system performance. This work advances geospatial code modeling techniques and facilitates the application of LLMs in geoinformatics, contributing to the integration of generative AI into the field.