Posts

Showing posts from June, 2025

M6

Image
 

Module 5 Lab

Image
  We were tasked with writing a script that creates a geodatabase, copies all feature classes from a data folder into it, then populates a dictionary with the names and populations of New Mexico county seat cities. This was by far the largest and most complicated script project I have done so far. It was without direction so I had to outline what I was thinking and try lines of commands to see if they would work and put it all together in the outline. One of the main issues I was toward the beginning of my process. I didn’t really understand what setting arcpy.env.workspace was doing. I thought it was just setting a default folder, but it actually controls where ArcPy looks for data and sometimes even affects how tools behave. When it was pointing to the wrong folder, ListFeatureClasses() just returned nothing, and I had no idea why. I also had so many issues with file paths like forgetting to use raw strings (r""), accidentally adding extra slashes, or copying paths from Win...

Module 4 Lab

Image
  These are the Notebook script output results from this weeks lab pt 2. These results are telling me that my script successfully ran AddXY, Buffer, and Dissolve tools to a hospitals shapefile that I had in a map on ArcGIS Pro.  This was a bit of a difficult task for me. I had to sit and just consider the task at hand for a while. At first, I was just thinking about what I already had, and where I needed to get it, in terms of ArcGIS Pro tools and functions. I am pretty skilled with ArcGIS Pro, so doing these tasks would be pretty easy if I were not scripting it. However, I was trying to keep in mind not only all of the scripting language rules, but also whether I needed to use try-except statements to run through the script and catch issues. I then broke my individual tasks down and focused on each separately. First was addxy coordinates. I understand this function in Arc Pro, but how do I script it in python? I went back into my notes and the textbook and found the main comm...

Module 3 Lab

Image
  This weeks lab we expanded on debugging problems in a script. The first two parts felt pretty natural, like common sense. Making cases of text match each other, being consistent, proper spelling, etc. The third part felt a bit more uncomfortable. We had to find where we thought there was an error and use try-except statements to wrap around the script so the interpreter would catch potential issues, run the script anyways, and tell us where the issues were. This task took me a while to get correct. I had to run some different ideas and go back to the module resources and drawing boards before I finally got this to work right.