Module 6 is the last module of the GIS Programming (GIS5103) course. When I first started this course, I was overwhelmed. Python seemed like a language I would struggle to understand in any capacity, however the pacing and structure of this course has made me realize that this was not true. This module was the most enjoyable yet, as I was able to compile my skills and knowledge I have picked up throughout the course and use them to tackle new material. The result was the fewest headaches I have experienced in any of the six modules.
Module 6 covered how to work with geometries in Python for ArcGIS Pro. It covered the point geometry class, arrays, polyline geometries, polygon geometries, and multipart geometries. I learned many ways to manipulate these geometries, as well as read and write them using TXT files. The lab assignment focused mainly on polyline geometries and writing them to a TXT file.
The Module 6 lab assignment prompted me to create a script that:
1) Imports all modules, classes, and environments needed to achieve the end goal
2) Creates a searchCursor that iterates over three fields of a polyline feature
3) Creates and opens a new TXT file for writing
4) Creates a nested "for" loop within the searchCursor to iterate each point/vertex of each row
5) Created a vertex ID for each point/vertex of each row that counts up by 1
6) Prints a statement for each point/vertex that gives the Object ID, vertex ID, x,y coordinates of the point/vertex, and the name of the object the point/vertex belongs to
7) Writes the same information as step 6 to the new TXT file, closes it, and deletes the rows/cursor.
Working through this assignment was rewarding, as the TXT file offered a tangible outcome in real time. A flowchart outlining how my script works is shown below, followed by the resulting TXT file:


Comments
Post a Comment