GIS Programming Module 4
This week's covered exploring and manipulating data using Python.
The first part of this Module's assignment was to write a script that will create a file geodatabase and populate the geodatabase with data that was provided.
Once the file geodatabase was created and populated we used that for the second part of our assignment. Using a shapefile in the database we had to use a search cursor to filter out cities in New Mexico which are County Seats. The search cursor produced a list of County Seats along with the attribute feature type and the individual cities population.
Using the same data as was printed from the search cursor we created a second search cursor which populated an empty dictionary that we created. Once dictionary keys and values were assigned the dictionary had to be printed out.
There were lots of steps and lots of printing going on in this script so we had to make sure and use arcpy messages and print statement that we created to delineate and explain what was going on at any given time in the process.
Below is a flowchart outlining the script that I created for this assignment.
The results of the script I wrote:
Creating and populating a new file geodatabase.
Results from search cursor.
Final populated dictionary showing key and values City Names : Population.
The assignment for this module was fairly challenging. We had to write a long script with multiple operations. The length and complexity of the script allowed for the possibility of many errors. Thankfully the script could be broken up into smaller sections and tested individually. One issue is that with some many trial runs to test the script I had to constantly deal with locks on files. A small issues yet one that took up some time to correct.