Using AI tools to help with Geoprocessing.

When I completed my first two years of my PhD, and being out of school for almost 20 years has been both a challenge and very rewarding. One of the challenges that I have encountered is that I do not know what I do not know. The funny thing is, it is also a part of my research into Human Computing Interaction with regards to Emergency Management. I will post more on that later, especially as I write and publish our findings, but right now I am going to post on something that I learned and realized over my first year, which is how to embrace and use Large Language Generative Artificial Intelligence (LLGAI) tools to help me fill in the gaps in my knowledge.

In the beginning, I was very hesitant to use AI tools like ChatGPT in general because I wanted to do the work myself. Using tools to do the work that I should be doing felt unethical and just like cheating. As the first semester moved along, I was feeling out of my depth with a lot of my programming skills, but I was still determined to go without using them. It was not until one of my classmates suggested that instead of me beating my head trying to get the code to work, I give it to AI and ask it to find what was wrong or missing. When I said I did not want to use it, he challenged me to think: how was AI different than asking for help from a TA or professor? I had done the work, but there was something just not working. So I gave it a try, and it was a simple error that it showed, and I was able to fix the issue.

I used AI more in the second semester, like an assistant or a more advanced Google search. I used it to help find articles that I had read a long time ago by giving it some ideas from the article and asking it to find them. But then for one of my classes, I was tasked with a project to create a program that was meaningful to my work that used parallel or GPU processing. My thought was to go to LiDAR processing, but other than LAStools or ESRI, I was not sure what other options were available and if it was even feasible. So I asked the AI if this was possible with a simple task to change a projection of a LAS file.

Change LAS Projection

The query that started this process was just to take a simple LAS file that I captured using the 3D Scanner App on my phone. It defaults to 4326 (WGS 1984), and while it works, most processing and GIS workflows need it to be in a projected and not a geographic coordinate system.

Knowing I had ArcGIS, QGIS, and Grass, I asked ChatGPT if I could do this in any of them. The results gave lots of options, and one interesting option of a library I had not heard of yet, PDAL. It was from that I investigated PDAL and found it has a lot of good tools that can be used for LiDAR data, and it is open-source.

I investigated the library and found a lot of different functions that were useful. So I coded the tool, but then I wanted to see if I could make it a little more useful to change all LAS files. I asked for a simple Python code for the conversion, and it gave it to me. After some other prompts to make it more user-friendly, I got a really good script that scans the whole folder for LAS files, creates a new folder, and places the new projected LAS files.

Final Thoughts

It is extremely effective as a script, and I was super surprised at how I was to use the ChatGPT to help me create a meaningful tool. The thing about the use of LLM tools is that while they are powerful, you need to know what to put in to get a good result. I always think of the “Garbage In -> Garbage Out” that I have to explain when people expect super answers from GIS data. If the data are out of date, at a super low resolution, or had poor QC when being created, you are not going to get a good result no matter what.

So to effectively use the LLMs as powerful tools, you still need experts in the fields to make sure it is giving the right answers. Also, make sure you check the results. If you are getting code, ask for the code’s documentation, or if it gives you citations, track them down and skim them to see if they make sense with what you are writing. This will both help you to make sure that the LLM is giving good results, but also you can learn something from the source material. Otherwise, if it gave you bad results, you can try to fix the model by reporting it to the chat window.

The big thing with these AI tools is that they are tools. They are not meant to replace what you can do, but help you do more. In my example of the LiDAR data, I probably would find PDAL eventually, but it would take a lot longer and ever longer to write the script that I needed. The AI tool helped with both to get me to complete my final task. In writing, AI tools are great research partners, but having it write paper sections does not help you learn. And that is a major danger of AI tools: if it is not helping you get better, then you are just going to be left behind.


Note: I started this post a while ago and am just getting back to it.

Leave a comment