M6: Working with Geometries

Working with Geometries


Module 6. The last module for GIS Programming.

The objectives for this module were to:
• Create a search cursor to iterate over shapefile geometries.
• Demonstrate the ability to write vertices of a geometry to a text file.
• Contrast the different objects using in parsing over geometries within a script.

After the readings, lectures, and exercise I was feeling pretty confident. 

I only ended up having a few issues.

The first issue I had was some slight confusion since there was a slight difference between the assignment directions and the template. I kept losing my place between the two. I wrote my code from the instructions and then matched it up with the template. 

I focused on getting the “bones” of the script to work – mainly the writing to the text file. Once I achieved that I focused on all the print statements. 

I ended up having an issue when I added the print statement for the rivers search cursor – it worked but the loop through the array stopped working. I researched through the textbook and ArcGIS docs and found the “with” search cursor. After inputting that and fixing the indents, everything was working properly again.  


Screenshot of the final text file that shows the OID, Vertex ID, X and Y Coordinates, and the River Name 


 


Flowchartin' through this first part of summer has been a blast. Minus the occasional rogue wave.




I omitted all the extra print statements on the flowchart and pseudocode to keep things brief..ish. 

I'm still not sure if I have all the shapes and flow completely right but I know I'm in the right lane. 


And with that - This GIS Programming course is complete! 



I enjoyed brushing up and learning new GIS Python skills. At this point my brain is now programmed in if-else and for loops- and if I forget why I am in a room its because I "set" the wrong workspace






Honorary Dino Duck

See you blog readers in a few days. 
I'm going to enjoy a brief summer break
with the ducks of luck!






 






Comments