Programming Week 6: Geometries
In the last lab of the course, we were given a shapefile of rivers on Maui and had to write a .txt file of these rivers' names, information, and the XY coordinates of their vertices. We did this by creating a search cursor that iterated over each point in each array for each row in the rivers.shp file. Each row in the original file contains the information for a different river represented by a polyline feature. The points in each feature's array are the vertices that determine the curve of the line. For each feature, I numbered the vertices with a vertex ID. The resulting .txt file printed the feature ID, vertex ID, X coordinate, Y coordinate, and the river's name, as seen below. The one part of the script I struggled to write was the for loops for the cursor. Specifically, I wasn't sure how to format and concatenate the fields to be written to the .txt file. I tried using the field names themselves with different containers/field delimiters (for example, str("OI...