Tuesday, June 25, 2024

Working with Geometries - GIS Programming Module 6

 Hello everyone,

In this week's final edition of the GIS Programming blog series, we explore "Working with Geometries". I am sad to see this class ending, but I have taken so much away from it, I can't wait to dive even deeper into programming with Python. Some learning outcomes we were expected to take away from this course include being able to create a search cursor to iterate over shapefile geometries, demonstrate the ability to write vertices of a geometry to a text file, and then contrast the different objects using parsing over geometries within a script. At this point of the course it seemed pretty straightforward, so here is the flow chart that breaks down the process to reach the outcome in the screenshot below the flow chart:


By successfully following this script in the flow chart, you should reach this outcome:



In order of the appearance in the results above, the first number is the object id, and the second is the vertex id which is increased by one each time until the end of a feature and starts again for the next feature. After the two ID values, what is displayed next are the XY coordinates in that order. Finally, what is listed after all of those fields is the name of the features which are stream names. Overall the code is pretty straightforward, but the thing I struggled with the most was creating the text file for the outputted results. Once I was able to figure that out, the rest is history.

That is all for this class, I can't wait for the next one!

Thanks for reading!

No comments:

Post a Comment

Final Project and other maps created

 After eight weeks this class has come to its conclusion. Our last task was to come up with a project idea that is geographic and meaningful...