Monday, August 10, 2015

Final Project

A blog post was not required for the final project in my Python Programming course, however, I thought I would share my work as a last post for the class.

The final for the master's students was to create a script using some of the Python coding skills we had learned during the semester. I decided to use data from a small unpaid internship project I'm working on and use Python code to get me started. Using point and line data that I collected in the field, I wrote a script that would do some of the initial map creation and data manipulation steps I needed to make a trail map for the Roy Hyatt Environmental Center. My script included some code I knew from class, such as creating a geodatabase or copying files from one folder to another. It also included some code that I researched to figure out, such as changing the spatial projection or adding layers to a map document.

The steps of the script were: create a geodatabase, copy shapefiles from a folder into the geodatabase, project the feature classes from WGS 1984 to State Plan Florida North, add the feature classes as layers to a blank map document, and finally use the search cursor to look up the lengths of the different polylines in some of the layers and print the length in feet and miles. The script creation went very smoothly and it was enjoyable to see the map creation steps play out through code instead of within ArcMap tool dialogs.

Screenshot of section of code to add feature classes as layers to a blank map document. 

Screenshot of the data layers that were manipulated and added by a Python script to a blank ArcMap document. 

No comments:

Post a Comment