Debug & Error Handling
This week in GIS Programming we learned about the basics of debugging and error handling in Python. For the assignment, I debugged and handled errors in three different scripts that were associated with an ArcGIS file, TravisCountyAustinTx.aprx, which includes spatial data on various features in this region: parks, bike routes, facilities, and the county. For the first script, I debugged it to print a list of field names from park.shp. For the second script, I debugged it to print a list of layers in each of the project's data frames: With the third script, I handled errors in Part A by including a try-except statement, which essentially allowed Part B to run correctly (it contained no errors, only Part A did): This flow chart shows the steps necessary in executing this script, including importing arcpy, printing an opening statement, and then adding a try and except statement so that the script can run even though an error is included (an error in the path of the project f...