At some point during this course you've hopefully felt "the lightbulb go on" regarding how you might apply the lesson material to your own tasks in the GIS workplace. To conclude this course, you will be expected to complete an individual project that uses Python automation to make some GIS task easier, faster, or more accurate.
The project goal is up to you, but it is preferably one that relates to your current field of work or a field in which you have a personal interest. Since you're defining the requirements from the beginning, there is no "over and above" credit factored into this project grade. The number of lines of code you write is not as important as the problem you solved. However, we encourage you to propose a project that meets or even slightly exceeds your relative level of experience with programming.
You will have two weeks at the end of the term to dedicate completely toward the project and the Review Quiz. This is your chance to apply what you've learned about Python to a problem that really interests you.
One week into Lesson 4 you are required to submit a project proposal to the Final Project Proposal Drop Box in Canvas. This proposal must clearly explain:
- The task you intend to accomplish using Python
- How your proposed solution will make the task easier, faster, and/or more accurate. Also explain why your task could not simply be accomplished using the "out-of-the-box" tools from Esri, or why your script gives a particular advantage over those tools.
- The deliverables you will submit for the project. A well-documented script tool is highly encouraged. If the script requires data, describe how the instructors will be able to evaluate your script. Possible solutions are to zip a sample dataset for the instructors, demonstrate your script during a Zoom session, or make the script flexible enough that it could be used with any dataset.
The proposal will contribute toward 10% of your Final Project grade, and will be used to help grade the rest of your project. Your proposal must be approved by the instructors before you move forward with coding the project. We may also offer some guidance on how to approach your particular task, and we'll provide thoughts on whether you are taking on too much or too little work to be successful.
As you work on your project, you're encouraged to seek help from all resources discussed in this class, including existing code samples and scripts on the Internet. If you re-use any long sections of code that you found on the Internet, please thoroughly explain in your project writeup how you found it, tested it, and extracted only the parts you needed.
If you're having trouble thinking up a project, you can derive a proposal from one of the suggestions here. You may have to spend a little bit of time acquiring or making up some test datasets to fit these project ideas. I also suggest that you read through the Lesson 4 material before selecting a project, just so you have a better idea of what types of things are possible with Python.
- Compare dataset statistics: Make a tool or script that takes two feature classes as input, along with a field name. The tool should check whether the field is numeric and exists in both feature classes. If both these conditions are met, the tool should calculate statistics for that field for both feature classes and report the difference. Statistics could be sum, average, standard deviation (if you are feeling brave), etc.
- Compare existence of features in two datasets: Make a tool or script that reads two feature classes based on a key field (such as OBJECTID). The tool should figure out which features only appear in one of the feature classes and write them to a third feature class. As a variation on this, the tool could figure out which features appear in both feature classes and write them to a third feature class. You could even allow the tool user to set a parameter to determine this.
- Calculate and compare areas: Make a tool or script that tallies the areas of all geometries in a feature class, or subsets of geometries based on a query and reports the difference. For example, this tool might compare "Acres of privately owned wetlands in 2008" and "Acres of privately owned wetlands in 2009."
- Find and replace: Make a tool flexible enough to search for any term in any field in a feature class and replace it with another user-provided term. Ensure in your code that users cannot modify the critical fields' OBJECTIDs or SHAPEs. Also ensure that partial strings are supported, such that if the search term is found anywhere within a string, it will be replaced while leaving the rest of the string intact.
- Parse KML, XML, or JSON and write to a feature class: Make a tool or script that reads a KML file, or an XML or JSON response from a Web service, and writes the geometries to a feature class. (You'll get some exposure to reading text-based files in Lesson 4.)
- Concatenate name fields: Write a tool or script that takes a feature class as input, as well as "First name," "Middle name," and "Last name" parameters that represent fields in the feature class. Your tool should add a new field for each record that contains the first, middle, and last names separated by one space. Your tool should intuitively handle blank records and records that have no middle name.
- Process rasters to meet an organizational need: Write a tool or script that takes a raw elevation dataset (such as a DEM), clips it to your study area, creates both hillshade and slope rasters, and projects them into your organization's most commonly used projection. Expose the study area feature class to the end user as a parameter.
- Parse raw textual data and write to feature class: Find some data available on the Internet that has lat/lon locations but is in text-based format with no Esri feature class available (for example, weather station readings or GPS tracks). If you need to, you can copy the HTML out of the Web page and paste it in a .txt file to help you get started. Read the .txt file and write the data to a new feature class. (You'll get some exposure to reading text-based files in Lesson 4.)
- Make an MXD repair tool: Make a tool that takes an old and new workspace path as inputs and then repairs all the broken data links in an MXD. (You can do this using the arcpy.mapping module described in Lesson 4.)
- Make a "map book": Make a tool that opens a series of MXDs, data frames, or map extents and constructs a multi-page PDF from them (You can do this using the arcpy.mapping module described in Lesson 4.)