Goals
The goal of exercise nine was to create a custom script tool that will generate a swiss hillshade. The tool will be kept in a custom toolbox in a geodatabase and will be accessible to use within ArcMap. This will be a much shorter Python script.
Methods
Exercise nine's python script starts out like all of the previous scripts. The first step is to ensure that the script is running properly by using a print statement. The second step is to import the system modules. In this exercise, we import os, shutil, time, datetime, and arcpy. Once the modules are imported, we can move on to the next objective. In this next step the GetParametersAsText function is used for each of the input feature classes. This allows the user to specify the name of the DEM directly into the tool. So the tool is portable and can be used in many different situations and projects. Next, variables are set up. Once the proper variables are set up, a try statement is set up. Within the try statement, the process to generate the swiss hillside is added. This includes using the divide function, hillshade function, focal statistics function, and plus function. Now at the end of the try statement, there needs to be an except statement. This statement will make it so that an error message will be reported if the try statement fails. This is the end of the script to make the swiss hillshade tool. The next step in the exercise was to add it to a tool box and to use the add script wizard to set up the script for ArcMap.
Results
This exercise was very short but I think that the results of it were very useful. A nice short script to create a tool that you can put into ArcMap and then use again and again is a very helpful skill to have. The results of this exercise are below in the form of the python script for the swiss hillshade tool.
Conclusion
As I said earlier, this was a very short exercise but an extremely useful one. Doing this exercise made me think, if someone works for a company and they need to execute a GIS process many times every day, it would be extremely helpful to be able to just write a script once and create a tool for it. This way The script can already have the process built into it and you can save yourself a bunch of time. This exercise truly showed us a very useful python tactic.

