GIS Programming- Exploring and Manipulating Data
This week we learned about exploring and manipulating data in ArcGIS Pro with Python scripting. We learned about a variety of tools and methods, such as describe, exist, listing, dictionaries, and cursors. In the assignment, we were given a variety of tasks. First, we were to create a new file geodatabase. Next, we were to list all of the feature classes in another folder. We then copied those feature classes into the new file geodatabase. Using one of the files in the new geodatabase, we used the search cursor to identify the objects that matched specific criteria and printed that information. Finally, we created a dictionary with this information.
I encountered issues with populating the empty dictionary. I was attempting to use the row.getvalue method, I kept receiving the error that my tuple did contain the attribute. I began my troubleshooting by searching for various methods to update dictionaries. From there I edited small things in my script, such as the input fields and the row.getvalue method formatting. I then researched the specific error I was receiving and found an example that used indexing instead of the get value method. I made sure all three of the fields I was considering were included in the input fields, and then I used the index method. It was very easy and common sense once I set it up.
The output of the final script is included below.
Comments
Post a Comment