Module 6: Working with Geometries
The purpose of this week's lab was to explore the geometries of a shapefile by writing vertices to a text file. The final script created a new TXT file, used a search cursor to iterate over the rivers shapefile geometries with for loops, and then writing data to the new TXT file. The final TXT file contains the following data from the rivers.shp : feature OID, vertex ID (created in the script), x & y coordinates, and the name of the feature. Below is a screen shot of part of the data in the new TXT file (the full TXT file is not shown as it is very long and contains 0-25 features with a total of 247 vertices). One of the things that made creating and running this script easy was the use of geometry tokens, specifically OID@ and SHAPE@. Geometry tokens are pieces of code that allow us to interact and access specific information about the geometry of features, which saves time when working with large datasets and/or features with a lot of geometry information. The ...