Using Prompt Engineering with Generative AI for the Analysis of Sentinel-2 Satellite Imagery on Google Earth Engine Platform
Main Article Content
Abstract
This study aims to evaluate the potential of prompt engineering combined with generative AI to translate natural language into JavaScript code for Google Earth Engine (GEE), enabling land use classification of Sentinel-2 imagery in Mueang Khon Kaen District using a Support Vector Machine (SVM) classifier. The results demonstrated that code generated through prompt engineering and Generative AI could be effectively utilized for processing large-scale geospatial data on GEE, achieving 87 % overall accuracy and a Kappa coefficient of 0.84. The effectiveness of the results depended on two primary factors: (1) the quality of training data for the SVM classifier, and (2) the quality of natural language prompts used with Generative AI. Additionally, the user's geospatial expertise proved essential for optimizing command design, selecting appropriate indices, sampling code examples, and interpreting results. This research demonstrates that Generative AI combined with prompt engineering can serve as a valuable tool for supporting code generation for spatial data analysis on GEE, reducing technical barriers and expanding access to spatial data analysis technology for general users through effective natural language interaction.
Article Details

This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.
References
Biswas, J., Jobaer, M.A., Haque, S.F., Islam Shozib, M.S. and Limon, Z.A. (2023). Mapping and Monitoring Land use Land Cover Dynamics Employing Google Earth Engine and Machine Learning Algorithms on Chattogram, Bangladesh. Heliyon, 9(11), 1-23. https://doi.org/10.1016/j.heliyon.2023.e21245
Brown, T.B., Mann, B., Ryder, N., Subbiah, M., Kaplan, J., Dhariwal, P., Neelakantan, A., Shyam, P., Sastry, G., Askell, A., Agarwal, S., Herbert-Voss, A., Krueger, G., Henighan, T., Child, R., Ramesh, A., Ziegler, D.M., Wu, J., Winter, C., ... Amodei, D. (2020). Language Models are Few-Shot Learners [Preprint]. arXiv. https://doi.org/10.48550/arXiv.2005.14165
Denny, P., Leinonen, J., Prather, J., Luxton-Reilly, A., Amarouche, T., Becker, B.A. and Reeves, B. N. (2024). Prompt Problems: A New Programming Exercise for the Generative AI Era. In Ben Stephenson & Jeffrey A. (Eds.), The 55th ACM Technical Symposium on Computer Science Education (pp. 296-302). https://doi.org/10.1145/3626252.3630909
Garg, A., Nisumba Soodhani, K. and Rajendran, R. (2025). Enhancing Data Analysis and Programming Skills Through Structured Prompt Training: The Impact of Generative AI in Engineering Education. Computers and Education: Artificial Intelligence, 8. https://doi.org/10.1016/j.caeai.2025.100380
Hochmair, H.H., Juhász, L. and Kemp, T. (2024). Correctness Comparison of ChatGPT-4, Gemini, Claude-3, and Copilot for Spatial Tasks. Transactions in GIS, 28(7), 2219-2231. https://doi.org/10.1111/tgis.13233
Hou, S., Shen, Z., Zhao, A., Liang, J., Gui, Z., Guan, X., Li, R. and Wu, H. (2025). GeoCode-GPT: A Large Language Model for Geospatial Code Generation. International Journal of Applied Earth Observation and Geoinformation, 138. https://doi.org/10.1016/j.jag.2025.104456
Jhonnerie, R., Oktorini, Y., Volcherina Darlis, V., Pebriandi, P., Prianto, E., Fatmawati, R., Nofrizal, N., Ramses, R., Miswadi, M. and Rahmatdillah, R. (2024). Integration of Generative Artificial Intelligence and Google Earth Engine for Mangrove Land Cover Mapping. BIO Web of Conferences, 136. https://doi.org/10.1051/bioconf/202413603002
Li, Z. and Ning, H. (2023). Autonomous GIS: The Next-Generation AI-Powered GIS. International Journal of Digital Earth, 16(2), 4668-4686. https://doi.org/10.1080/17538947.2023.2278895
Osco, L.P., Lemos, E.L., Gonçalves, W.N., Ramos, A.P.M. and Junior, J.M. (2023). The Potential of Visual ChatGPT for Remote Sensing. Remote Sensing, 15(13). https://doi.org/10.3390/rs15133232
Sainarmtip, R., Wetchayont, P. and Chenrai, P. (2021). Development of Geothermal Potential Resources Map using Land Surface Temperature from MODIS in Northern Thailand. RMUTI Journal of Science and Technology, 14(1), 68-82. https://ph01.tci-thaijo.org/index.php/rmutijo/article/view/241847/166073 (in Thai)
Tamiminia, H., Salehi, B., Mahdianpari, M., Quackenbush, L., Adeli, S. and Brisco, B. (2020). Google Earth Engine for Geospatial Big Data Applications: A Meta-Analysis and Systematic Review. ISPRS Journal of Photogrammetry and Remote Sensing, 164, 152-170. https://doi.org/10.1016/j.isprsjprs.2020.04.001
Tao, R. and Xu, J. (2023). Mapping with ChatGPT. ISPRS International Journal of Geo-Information, 12(7). https://doi.org/10.3390/ijgi12070284
Van Ninh, T. and Waisurasingha, C. (2018). Land Use/Cover Change and Landscape Fragmentation Analyses in Khon Kaen City, Northeastern Thailand. International Journal of GEOMATE, 15(47), 201-208. https://doi.org/10.21660/2018.47.SGI174