Module 5: Explore & Manipulate Data

This week's assignment focused on automating geoprocessing tasks. The goal was to write a script that created a new file geodatabase, copied all shapefiles from a data folder into it, and then searched for a New Mexico "county seat" cities to build a dictionary of city names and populations.

The script walked through a series of tasks:
Set the workspace and import modules; Created a file geodatabase in a Results folder using the student account name; Listed all feature classes in the Data folder; Copied those shapefiles into the new geodatabase; Used a Search Cursor to pull out the fields needed; Built a dictionary mapping city names to population values; Printed the final dictionary, displaying all the results.

The hardest part for me was step 4: Copying feature classes into the geodatabase. While copying shapefiles to the new geodatabase, I wasn’t initially getting the elapsed time message for each shapefile. This was because I was calling the function outside the loop. To fix this, I moved the line of code inside the loop. This allowed me to print the correct elapsed time for each copied feature.

It was satisfying to see the script run from start to finish, producing a clean dictionary of the cities and their population. Even though I hit a few bumps along the was, figuring out the issue made me feel more confident in handling ArcPy scripting logic.







 

Comments

Popular posts from this blog

Module 1- Overview of ArcGIS

Module 5: Data Points and Geocoding

Module 6: Georeferencing, Editing, & 3D.