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. |
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
Post a Comment