Wednesday, June 19, 2024

Exploring & Manipulating Data - GIS Programming Module 5

 Hello everyone!


This week's lab seemed to be a doozy, it was definitely a bit more complicated. Luckily I was able to work through it and reach the desired outcome. For this week's lab we were expected to be able to work with search cursors and work with lists and dictionaries. We were also expected to check for, describe, and list data, then be able to demonstrate the correct usage of update and insert cursors. Once we did that, we then had to validate table and field names then design a logical model of script using a flow chart. This flow chart demonstrates the flow of the code I wrote and then here are the result:


Here is the outcome:



The first bit of the code is meant to create a new file geodatabase for the lab data. We are doing this so that we make a copy of the data in our database to then pull from later in the code. The CopyFeatures_management line is what copies the data to your newly created database. The next thing we need to do was to make query of our cities shapefile the displays the name of the city, the feature type and population for cities that are county seats. This was done by first identifying the fields I need to use for displaying the data, then create an empty dictionary that will be populated by these fields. After the dictionary was created, I need to write a with, as: statement that setup the Search cursor. This is what populated the dictionary which I then printed to reach the results above.

This weeks lab was a little difficult for me due to the timing of the assignment with a work trip, but I believe I was able to complete it successfully.

Thanks for reading!


No comments:

Post a Comment

Final Project and other maps created

 After eight weeks this class has come to its conclusion. Our last task was to come up with a project idea that is geographic and meaningful...