Posts

Showing posts from June, 2025

GIS5103 Module 6: Working with Geometries

Image
     In this week’s GIS Programming lab, we focused on creating a search cursor to iterate over shapefile geometries and demonstrating the ability to write vertices of a geometry to a text file. Ultimately, we needed to create a script that successfully wrote (into a text file, such as in Notepad++) with specific vertex/point information: Feature OID Vertex ID X-coordinate Y-coordinate Name of river feature The below screenshot is a snippet of the completed, successful script outcome. From left to right, items are: OID, vertex ID, X-coordinate, Y-coordinate, and name of feature. See below flowchart providing a logical flow of script created:

GIS5103 Module 5: Exploring & Manipulating Data

Image
     This week’s lab in GIS Programming focused on exploring and manipulating data. We wrote a script that created a new file geodatabase (fGDB), copied relevant data into the created fGDB, and populated a dictionary with names and populations of the County Seats within New Mexico, USA. To view the thought process in creating this script, see below flowchart:   Flowchart documenting process of creating requested script outcome To view the results indicating the successful run of the script, see below screenshots:        The main problem I had in this lab was finding an effective way to populate each item to the created dictionary.   After several trials of code, I went back and used the Search Cursor for loop with the same parameters to only select the correct key and value. I was setting my key to ‘County Seats’ when it should have been “NAME”. After figuring that out and trying more coding that was more along the lines of what was de...

GIS5103 Module 4: Geoprocessing

Image
     This week's lab in GIS Programming gave us insight on geoprocessing operations. We focused on creating and modifying scripts, using ModelBuilder within ArcGIS Pro to create scripts, and understanding toolboxes (in ArcGIS Pro).  Successfully ran script results 1          Adding XY Coordinates: Following the Exercise instructions helped guide me throughout this lab. I understood if I were to run something in Python that may include arcpy, I would need to first import arcpy – this isn’t necessarily needed when working in ArcGIS Pro Notebooks as ArcGIS is already aware of arcpy. I wanted to be able to import my environment workspace, so I needed to communicate effectively in writing the location of the data. Because we were tasked to focus on the hospitals shapefile, I made that the in_features . I then used the arcpy.management.AddXY(in_features) code to apply XY coordinates to hospitals, and created a print code that printe...

GIS5103 Module 3: Debugging and Error Handling

Image
     Module 3 in GIS Programming focused on debugging and handling errors within scripting. We used our previously gathered knowledge in this course to supplement the objective of this lab. We were given (3) separate scripts to determine what is the error in each, how to fix the errors, and we were also given the opportunity to use a try-except statement to allow for a script to run with an error. It might seem like you would want all scripts not to have error -- sometimes we would want to have the script run with that error as an exception, but print the resulting error statement that arises.  Our results are as follows:  Script 1:  Script 1 Results Script 2: Script 2 Results Script 3: Script 3 Results In Script 3, we utilized the try-except statement to indicate the error in Part A of this task - see below for a flowchart of the implemented statement:  Try-except statement flowchart Part A in Script 3 wanted us to be able to use the try-except statem...