Module 5: Explore and Manipulate Data

 For this module, I worked with the ArcGIS notebook to explore and manipulate data. I focused on working with geodatabases, feature classes, lists, dictionaries and cursors. 

The first goal was to create a new file geodatabase in the Results folder using my student username. After setting the workspace and enabling overwrite output, I generated a new geodatabase. 

Next, I generated a list of all shapefiles in the Module 5 Data folder and used a for loop to copy each feature class into the newly created GDB. The describe function and its basename property were important because geodatabases do not use the .shp extension found in shapefiles. This process reinforced the use of loops and ArcPy geoprocessing tools. 

After the data was copied, I changed the workspace to the new geodatabase and created a search cursor for the cities feature class. Using a SQL where clause, I filtered the records so only cities classified as County Seats were returned.

I then created an empty dictionary called county_seats and populated it using a loop through the search cursor results. The city name was used as the dictionary key, while the population value was used as the corresponding value. Once the dictionary was populated, I printed the results to verify all county seats cities and their populations were successfully stored and deleted the cursor/row. 

This assignment helped me better understand how ArcPy functions can be used in ArcGIS to explore and manipulate data. I also learned how to use geoprocessing messages and print statements to monitor the progress of a script and make debugging easier. The script results are posted below. 







A flowchart of the process is described below: 


Comments

Popular posts from this blog

Module 3: Error Handling and Debugging

Module 1: Crime Analysis

Module 2: LiDAR