Wednesday, July 13, 2016

GIS 4102/5105: Week 8 - Geometrics

Over the past couple of weeks, I learned how to write a text file using PythonWin. During the assignment, we were asked to create multiple for loops to create the text file shown below. We first created a search cursor for the rivers shapefile provided. The cursor called on the following three things: the OID field, the SHAPE geometry object, and the NAME field.  The first for loop created iterated through each row/feature in the shapefile's attribute table.  Within the row for loop, I then created another loop which iterated through each point in the array of the row/feature. I used the .write() method to add a line to the text file shown below. The file includes the feature/row OID, the vertex ID, the X coordinate followed by the Y coordinate, and the name of the river feature. 


No comments:

Post a Comment