This week was the most challenging lab yet. I created a script from scratch to create a new file geodatabase, copy feature classes into it that met a SQL criteria, create a dictionary, and lastly list the keys and values of the said features classes into the dictionary.
Below is a flow map of my script.
Two struggles I had:
1
My first struggle was to print the list of copied files and print
times. I couldn’t figure out what was wrong in my statement, as it ran but did
not print. One of my peers mentioned that it’s because when using
row.GetValue(), it can register the item as an integer and not print. I then
cast a string str(row.GetValue()) and resolved my issue.
2
My second biggest issue was determining how to place the statement
to add the key and values to the dictionary. <dictionary
variable>[<key>]=<value> I added the statement inside my for loop,
after defining key and value. Also at the suggestion of a peer, I removed the
<> and the statement worked. county_seats.update({key:value})
Below you can see the script results.
Comments
Post a Comment