The first step is to create a search cursor to find the necessary data > then create a writable text file > then loop over each feature > and for each part of each feature, print the vertex coordinates and other data to both the text file and the interactive window.
Here's the pseudocode I wrote to show how the script works:
Cursor = OID, Shape, Name in rivers.shp
Text = rivers.txt
For row in cursor:
Vertex = 0
For point in row
Vertex + 1
Write to text OID, Vertex, X and Y coordinates, and Name
Print OID Vertex, X and Y coordinates, and Name
And here's part of the text file my script produced:
For me, this was definitely the hardest assignment yet, but I was really looking forward to this lesson and I'm glad to be starting to understand how manipulating geometries works.
No comments:
Post a Comment