Wednesday, June 29, 2016

Exploring and Manipulating Spatial Data

GIS Programming - Mod 7

This week we created a geodatabase using the CreateFileGDB_ management function, then created a list of shapefiles in our Data folder and copied them to our geodatabase using the CopyFeatures_ management function.

With our geodatabase set we then created a SearchCursor for the city names and populations for those cities within the cities feature class that were county seats in the state of New Mexico.  This was the only real problem I had with the assignment.  I was having a little difficulty figuring out how I was going to populate the dictionary two steps ahead, but I decided not to worry about that step until after I finished this step.  In the exercises we performed a SearchCursor and it was pretty straight forward, but we were only looking to search the attributes of one field in the table, whereas for the assignment we were dealing with two fields.  It took me a while to figure out the SearchCursor was basically going to build a list of the two fields based on the attributes of the third field.  Once I realized that I was able to figure out my syntax and move on.  I created an empty dictionary, then populated it within a for loop by pulling the fields from the list I created with SearchCursor and updating the dictionary with them.

Getting all this down in the flowchart was a bit of a chore.  Not so much the different steps, but adding all the print statements was kind of a pain since we had to add one before and after each step.  I ended up combining the ones that came between steps and just hope that will be good enough.

No comments:

Post a Comment