Posts

Showing posts from June, 2024

Working Geometries

Image
 This week was our final assignment. For this assignment, we were to write a code to create a new text file and copy all the information for the point data for 25 features. This data included the Feature OID, Vertex ID, X coordinates, Y coordinates, and the name of the river features. I created the code below, and the images following the code show the resulting text file.

Explore and Manipulate Data

Image
This week's assignment was to write a script that could create a new geodatabase, copy the features from the data folder to the new geodatabase, and using a search cursor create a new dictionary populated with the name, feature type, and population of each County Seat in New Mexico.  I completed the assignment easily enough, but I did have some difficulties throughout the process. I mainly received nameErrors and executeErrors. These were due to my mixing up d's and b's when typing out "gdb" in the code, and the code running partially then not being able to overwrite what had been previously created when rerunning it after fixing the errors. Below is the finished code.

Geoprocessing

Image
 The geoprocessing module involved writing a script to clip, select, and erase specific areas within a shapefile. We also learned how to write a script that adds XY coordinates, creates a buffer, and dissolves buffers into a single feature. I had a difficult time understanding the instructions and examples on the ArcGIS site, but through going back through the module and a lot of trial and error I was able to complete the tasks. Below are screenshots of some of the code used.

Debugging and Error Handeling

Image
For this week's assignment, we were to fix various errors in code for a map in ArcGIS Pro. I had trouble with the second script and could only get it to work using notebooks in ArcGIS Pro. The last one was more difficult. It took me the longest to figure out where the try/except statements should be within the script. Below are the results and some of the mended code. Figure 1. Script 1 results after fixing errors. Figure 2. Script 2 code and results after fixing errors in ArcGIS Pro. Figure 3. First half of script 3 code and results after fixing errors in ArcGIS Pro.                          Figure 4. The second half of script 3 code and results after fixing errors in ArcGIS Pro.