This week I learned about working with geometries in Arcpy; how to read, write, and work with multipart features. We began by setting our workspace and utilizing a cursor in order to create a new txt file, and write data into it from the rivers.shp. Below is a short summary of the steps I took:
- Import arcpy
- from arcpy import env
- set workspace
- set overwrite
- set outpath
- define variable for river.shp
- create txt (rivers_ESG.txt)
- create search cursor
- set variables for OID, NAME, and vID to be able to call upon them
- set first for loop in cursor
- vID + = 1
- set second loop in row[1]
- set third for point in part
- print OID, vID, coordinates x,y, NAME
- output.write (same as above) to add to text file
Below are the script outputs for the final script and a snip of the newly created txt file.
Comments
Post a Comment