Posts

Showing posts with the label GIS4102

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. 

Module 2 Lab

Image
  In this lab we learned how to insert written script into ArcGIS Pro notebook and then find bugs and fix them This was different than anything I have done before, so it took me a while to differentiate a spot where an int needed to be a string. Once I finally figured this out, the rest felt easy. We then had to write our own code to take the written script of the dice game and make it play out and then remove a specified integer from it. A lot of the language, especially complex statements like having the program take the count of the # of times the integer appears and remove them from the list. Some of the ways you put these statements together still feels different, but I am getting the hang of it. I tried to make my script of the game sound a bit more interactive like a video game, so I made it say "Removing..." as if it was actively working on doing this task. 

Module 1

Image
  I thought this module lab was fairly easy to comprehend and perform, up until creating the flowchart for the math problem. We input an already written script into Python IDLE, which created our course and module folders for us. I thought this was a pretty interesting concept because it standardizes things that would be somewhat time consuming throughout the course. Now we don't have to focus on naming conventions as much, as the entire course folder is already created. The flowcharting, though, I found to be a bit more difficult. I have never done anything like this, but while reading and watching the module materials, it seemed pretty straight forward. Once I actually was presented with the problem of converting 3 radians into degrees, I became confused about how to break it down into a flowchart. Was I supposed to detail each individual number and unit first? It was feeling very foreign to me. So, I went back through the materials and watched some youtube videos about this conc...