Module 4-Exploring and manipulating data, introduces us to different approaches of handling data within ArcGIS applications. We also look more in-depth at lists, tuples, and dictionaries as well as built-in Python functions, cursors and the ArcPy data modules.
Using the four step template for this lab, Identify your input, Identify the goal or objective, create list of tasks, and if you have met your goals, I was able to write a script that met the requirements of the assignment.
Identify your Input-
I identified the input as the shapefiles in the Data folder.
Identify the Goal or Objective-
I was tasked to create a new file geodatabase, copy shapefiles to the new geodatabase, list the results of a search cursor with a where clause and create a new dictionary and populate it with entries from the search cursor query.
Create List of Tasks-
Create the file geodatabase with the CreateFileGDB_management tool.
Use a For loop, the Describe tool and CopyFeatures_management tool to copy shapefiles to the new file geodatabase and only copy basenames.
Use a Search cursor with a where clause (Feature = County Seat) and a For loop to list names of cities, Feature type, and city population.
Create a new dictionary and populate with a For loop using the results of the previous Search cursor query that will provide entries for the dictionary that are just the city name as the key and the population total as the values, just for cities that are County seats.
Have you met your Goals-
I was able to write a python script that was successful in meeting all the required tasks as listed in the screenshots above.


Comments
Post a Comment