Thursday, July 16, 2015

Working with Geometries

 
In Module 8, we explored how to work with geometries - points, lines and polygons.  The use of geometry tokens to simplify some operations was one topic; SHAPE@LENGTH and SHAPE@XY were two of the tokens we worked with. We also learned how to parse points and polylines in order to get at the values within the geometry. The last part of the lesson focused on reading and writing geometries.
 
Below are the results of a script we worked on this week.  Each line contains data about a point or vertex in a feature.  The shapefile that provided the data was of rivers in Hawaii.  The script retrieved information including the object ID, x and y coordinates, and name of the river for each point, then created a new text file and wrote the information to that text file.
 
 
 
 
I had some trouble with the last part of the lab, writing to the text file.  My two issues were that I didn't put the writing part of the script inside the most nested loop - I had it all the way out, not indented.  Also I was using double quotes around by variables, so I kept getting the name to print and not the values of the variables.

No comments:

Post a Comment