Wednesday, June 17, 2026

Module 6 Blog: Working with Geometries and Search Cursors

 For Module 6, I created a Python script that uses geometry objects to extract vertex information from the rivers shapefile. The script uses a SearchCursor to access each river feature’s object ID, geometry, and name. From there, I used the getPart() method to access the vertices that make up each river line.


[Insert screenshot of completed rivers_.txt file here]

The screenshot above shows part of the TXT file created by my script. Each line includes the feature OID, vertex ID, X coordinate, Y coordinate, and river name. This confirmed that the script successfully wrote vertex information for the river features.


[Insert flowchart image or exported draw.io flowchart here]

The flowchart shows the basic logic of my script. The process begins by importing modules, setting the workspace, creating the SearchCursor, and opening the output TXT file. The script then loops through each river feature and each vertex within that feature. For every vertex, it writes the required information to the TXT file and prints the same information to show progress.

One important part of this assignment was understanding why SHAPE@ was needed instead of SHAPE@XY. SHAPE@ gives access to the full geometry object, while SHAPE@XY would only return one coordinate pair. Since the goal was to write all vertices, the full geometry object was necessary. Overall, this lab helped reinforce how nested loops are used to work through features, geometry arrays, and individual points.

Friday, June 12, 2026

Exploring and Manipulating Data with ArcPy

 

Exploring and Manipulating Data with ArcPy– 

Module 5 Assignment Reflection

This week’s assignment focused on exploring and manipulating spatial data using ArcPy. The main objective was to create a Python script that automatically creates a file geodatabase, copies spatial data into it, and uses a Search Cursor to build a dictionary containing New Mexico county seat cities and their populations.

One of the most useful concepts I learned this week was how to use ArcPy's Describe, List, and Cursor functions together to automate repetitive GIS tasks. Instead of manually copying datasets and looking up attribute values, the script handled everything automatically.

Assignment Overview

The script completed the following tasks:

  • Created a new file geodatabase in the Results folder
  • Listed all feature classes in the Data folder
  • Copied each feature class into the new geodatabase using a loop
  • Used a Search Cursor to identify all cities classified as County Seats
  • Created and populated a Python dictionary using city names as keys and population values as dictionary values
  • Displayed progress messages throughout the process to make the output easier to follow

Script Results



Figure 1. Successful execution of the Module 5 script showing geodatabase creation, feature class copying, and population dictionary creation.

Script Flowchart



Figure 2. Flowchart illustrating the overall logic of the Module 5 script.

The flowchart was created to visualize the sequence of operations performed by the script. The process begins by importing ArcPy modules, setting the workspace, and enabling overwrite permissions. The script then creates a new file geodatabase and uses a loop to copy all feature classes from the Data folder into the new geodatabase. After the data is copied, the workspace is updated to the new geodatabase and a Search Cursor is used to retrieve the names and populations of cities classified as County Seats. These values are stored in a Python dictionary called county_seats, which is then printed to the output window. Creating the flowchart helped me organize the script logic and better understand how each step contributes to the final result.

What I Learned

This assignment helped reinforce several important ArcPy concepts:

  • Using ListFeatureClasses() to automate batch processing.
  • Using Describe() and the basename property when copying shapefiles into a geodatabase.
  • Creating and populating Python dictionaries from GIS data.
  • Using Data Access (arcpy.da) Search Cursors with ArcGIS Pro 3.6 syntax.
  • Creating SQL expressions to filter records.
  • Using flowcharts to plan and document script logic before and after coding.

The flowchart was especially useful because it provided a visual representation of the script structure and made it easier to follow the sequence of operations.

Challenges and Solutions

The most challenging part of this assignment was creating the Search Cursor and SQL query needed to retrieve only County Seat cities. I had to pay close attention to the required ArcGIS Pro 3.6 cursor syntax and ensure the correct field list was included in the cursor.

Another challenge involved understanding how the data moved through the script. Creating the flowchart helped clarify the workflow by breaking the script into logical steps, making it easier to troubleshoot and verify that each process was occurring in the correct order.

Friday, June 5, 2026

Geoprocessing with ModelBuilder and Python

Geoprocessing with ModelBuilder and Python

This week’s Module 4 assignment focused on geoprocessing in ArcGIS Pro using both ModelBuilder and Python. The assignment was a great way to see how visual workflows and scripting can accomplish many of the same tasks while offering different advantages. Through building a model and writing a Python script, I gained a better understanding of how geoprocessing tools work together and how GIS workflows can be automated.


Building the SoilErase Model

For the first part of the assignment, I created a ModelBuilder model called SoilErase. The goal was to identify areas within the basin that are suitable for farming by removing soils that are classified as "Not prime farmland."

The model completed three main steps:

  • Clipped the soils layer to the basin boundary
  • Selected soils classified as "Not prime farmland"
  • Erased those areas from the basin polygon

One thing I enjoy about ModelBuilder is being able to see the entire workflow laid out visually. It makes it easier to follow the analysis process and verify that each output is connected correctly before running the model. Watching the model come together also helped me better understand how geoprocessing tools depend on one another.




Complete Model


 Clip Tool Settings



Select Tool Settings



Erase Tool Settings


Final Model Output




Writing the Python Script

The second part of the assignment involved creating a Python script using ArcPy. The script performed three geoprocessing tasks:

  • Added XY coordinates to the hospitals shapefile
  • Created a 1000-meter buffer around the hospitals
  • Dissolved the buffer polygons into a single feature

I also used the GetMessages() function after each tool ran so the script would display the geoprocessing messages. This was helpful because it provided immediate feedback and confirmed that each step completed successfully.

One of the first things I did was set the workspace and enable output overwriting. These settings made testing much easier because I could rerun the script multiple times without having to manually delete previous outputs. It also kept the code cleaner since I didn't need to repeatedly type full file paths.

Screenshot Placeholder – Script Results

Insert screenshot of the successful script output messages here


Challenges and Lessons Learned

The biggest takeaway from this assignment was seeing how ModelBuilder and Python complement each other. ModelBuilder is excellent for visualizing workflows and quickly testing processes, while Python provides more flexibility and automation for tasks that may need to be repeated.

I also gained a better appreciation for the ArcGIS Pro Help documentation. Reviewing the syntax and code examples before running a tool saved time and helped prevent errors. When something didn't work as expected, the geoprocessing messages were extremely useful for figuring out what needed to be fixed.

Another lesson was the importance of environment settings. Simple settings like defining a workspace and allowing outputs to be overwritten can make scripts much easier to develop and troubleshoot.


Final Thoughts

Overall, this assignment provided valuable hands-on experience with geoprocessing in ArcGIS Pro. Building the SoilErase model helped reinforce the logic behind spatial analysis workflows, while the Python script demonstrated how those same processes can be automated through code. By the end of the assignment, I felt much more comfortable working with both ModelBuilder and ArcPy, and I can see how these skills will be useful in future GIS projects and professional applications.


Module 3 - Coastal Flooding

 Coastal flooding is one of the most destructive hazards associated with hurricanes, making accurate flood modeling an important component o...