GIS 4048 - Module 2 Assignment: Debugging and Error Handling
Module 2 - Part 1:
Script 1 had four errors when I ran the original downloaded script
from the (R:) file. I found there were 3 code analysis errors that needed to be
corrected for the script to run properly. Some of the errors included correct
punctuation errors (to match other parts of the code) and making sure the env.workspace
was directed to the correct file location. Once these simple errors were
corrected the code can just as it was described. I found it pretty cool that this code was able to print the categories from the .aprx GIS file.
Module 2 - Part 2:
Before beginning to work on script 2, opening the .aprx file in ArcGIS was necessary. I had to connect the .shp files in order to have the correct file path. Once this was done, script 2 had numerous small errors in the downloaded script. There were multiple “typos” in script 2, including symbol errors, extra characters in some places, and the addition of characters where they were missing. The first major error I found was making sure the file path was directed to the correct location. I found a majority of the errors in script 2 were in the # define variables chunk of the code. This script was good practice for getting familiar with the debugging tool and locating errors. After the code was corrected and run, the result was printing of the four .shp files that needed to be connected to the .aprx file. Neat!
Module 2 - Part 3:
The printed result from script 3 printed details out the four .shp files in the .aprx GIS file. It printed details about each layer such as data and spatial reference. For this script I only added one try-except statement in Part A and in Part B changed the project file path from module 3 to module 2. I was unsure if this change was allowed as per the directions said not to correct any errors, so I took a chance. I tried many different attempts with the "try-except" statements and finally got the final result (my submission) to print this result.
I feel much more confident this week with the assignment and
learning objectives. I find the debugging tool extremely useful! This tool will
be very helpful for all things coding going forward. I feel this tool helps
understand where errors occur in a much clearer manner. Honestly, I wish I
would have known about this tool when I took a class that used R (as long as
debugging is found in the R program).
I found the most challenging portion of the assignment was part 3:
make a code run even with errors. It was a little tough for me to follow along
in the video and to navigate the ArcGIS help website. The video quality is a
little blurry so that may have been part of the problem as I tried to watch the
example over a few times for a better understanding of the subject. I found the
question thread helped problem solve the most while working on this assignment
as I struggled to find “like” examples for my understanding. With time,
patience I was able to complete the assignment.







Comments
Post a Comment