GIS5103 Module 6: Working with Geometries

The final Python module is here, Module 6!

I forgot how quickly summer semesters can go by, but I'm glad I was able to cover so much ground in Python. It feels like night and day compared to the very first script we handled at the beginning of this course. Now, look at us, we've moved on to working with geometries, where we had to learn about geometry objects and multipart features, as well as reading and writing geometries.

Search Cursors came back to play with iterating over the Hawaii rivers shapefile. We had to take the 26 rivers within and create a TXT file that provided each river's name, ID, vertices, and coordinate data (X & Y).

I had a nice time working through this one, with minimal hiccups. The first part of the script is always the environment, and setting up my environment is becoming second nature -- I don't think I'll forget to import any necessary modules in the future. The second part of the script required creating a TXT file. This part gave me the most trouble due to human error in misplacing certain lines of my code, which resulted in my vertex IDs iterating straight through all the rivers and not resetting to "1" at the start of the next river feature.

Module 6 Script Results. From left to right in each column, Object ID, Vertex ID, River Name, and Coordinates.

Module 6 Script Flowchart. Starts with the Environment Settings, then enters the first For Loop which iterates each river feature, and lastly ends on the second For Loop which iterates each point/vertex in the river feature.

Overall, this course was very fulfilling and I loved being hands-on with scripting throughout! I am looking forward to putting my new Python knowledge to use on automating some workflows at work now!

Comments

Popular posts from this blog

GIS5050 Final Project: The Bobwhite-Manatee Transmission Line

GIS5007 Module 2: Typography

GIS5007 Module 3: Cartographic Design