Tuesday, August 7, 2018

GIS Programming Module 11

This post will focus on thing I have learned over the course of the semester in GIS Programming this year. The final Module focused on sharing tools. In the example above we took a tool and modified it so that we could share it either on networks or as a compressed .zip file.

1. First the fact that scripting can be used to run tools in ArcGIS blew my mind at first. Once we had a few lessons on the topic I was able to pick up the steps and recognize the scripting. It is actually a helpful way to run tool after tool without having to manipulate the feature classes in between.

2. This leads me to another thing I picked up along the course. At first I was overwhelmed when looking at certain scripts we were using for the lessons. As the class went on I was able to pick up the language much quicker and slowly, but surely understand the goal of the script. One day a commercial came on during a break in my favorite TV show (That 70’s Show). There was a giant computer screen with coding on it and it was meant to seem as if someone was hacking a computer, but I actually could make out some of the code!! I felt proud that I was learning something new having to do with computer language.

3. Finally the inner workings of ArcGIS  have always fascinated me and in this course we have learned yet another amazing capability of this program that make it far more efficient and ground breaking.

Wednesday, August 1, 2018

GIS Programming Module 10

This week in the lab we worked with taking a completed script and turning it into a usable tool in ArcMap. We set certain parameters for the tool and adjusted the script to then pull from the user inputs to make it universal. See the parameter settings and results windows below along with the steps to creating a tool.
1. The first step is to create the toolbox shell in ArcCatalog

2. Next you create a script tool in the toolbox and attach your .py script to the tool. This gives the tool guidelines on how to run.

3. Next you set parameters for data entry. This will allow for a better user interface and correct data entry.

4. Finally adjust your script to accept the data entered by the user instead of hard set file paths.

5. Check your script tool to confirm the proper operation.


Thursday, July 26, 2018

GIS Programming Peer Review 2

Peer Review 2
The work I chose to review incorporates an original idea of finding a solution to a problem that will arise in the future with the inevitable eruption of Indonesian volcanoes. Bear-Crozier, Kartadinata, Heriwaseso, and Nielsen’s (2012) application involves a Python based script used to simplify the process of installing and running a core prediction model. The model allows for analysis and prediction of volcanic ash fall following an eruption. The product was developed in cooperation with three major GIS agencies
The paper makes a strong case for the need for the solution. The hazards are clearly explained and show with an example how the research will help scientists predict the ash flow of future eruptions in the Indonesian region. The example itself is a great strength of the research showing that the developed script is in fact executable and provides valid analysis tools for scientists to use when studying the region. In the event that a volcanic natural disaster occurs in the region products will be available to provide the necessary evacuations and notifications. This was not possible with the previous data and models provided.
            One of the few weaknesses of the research is the usage of acronyms. The effort improves as the reader continues through the document, but at the beginning there are a few instances of acronyms being used that are research specific and everyday users would not understand the meaning. Descriptions are provided later in the body of the paper, but few instances at the start could leave the readers confused as to what is being discussed. This is only a minor readability flaw and would not affect the overall understanding of the research. The only other weakness I discovered is the fact that there is no new science developed in the research. The paper definitely describes a solution to a problem, but the solution is a Python based script that simplifies installation and running of a core model. There is definitely science involved in the programming of the package for running the core model (FALL3D). The script that the team developed is simply an adaptation that will make the process of volcanic ash fall analysis more streamlined. This is a weakness that does not take away from the research, but it does disqualify it as developmental in my opinion.
            The research is clearly laid out in chronological order how the study came about and who worked together to accomplish the results. The collaboration of three GIS departments shows the checks and validation that went on to achieve valuable and relevant results. If a single organization carried out the work then the results could be biased or not geared toward a universal solution. In this case the research methods are transparent and follow all scientific guidelines.
The single thing I liked most about the research is the use of illustrations. Being a visual learner the illustrations greatly increased my understanding of the study location and overall results of the research. There are many illustrations within the document that visually depict the processes and results of the study. The amount of illustrations is definitely a positive thing, but a few of the illustrations could have better labeling geared toward non-GIS familiar users. Some illustrations used an advanced or system specific labeling method that could make it confusing to some readers. I would have utilized a more “Plain English” approach to describing the technical illustrations.    
In wrapping up the study Bear-Crozier et al. (2012) conclude that the newly created process does in fact generate a usable product and proves the point with an example. I find this to be very important to the work because it shows the success of the research and how the accomplishments work in the analysis of future eruptions.

References
Bear-Crozier, A. N., Kartadinata, N., Heriwaseso, A., & Nielsen, O. (n.d.). Development of python-FALL3D: A modified procedure for modelling volcanic ash dispersal in the Asia-Pacific region (2012 ed., Vol. 64, Nat Hazards, pp. 821-838, Publication). doi:10.1007/s11069-012-0273-7

Monday, July 23, 2018

GIS Programming Module 9

This week in the lab we worked with Raster and Python scripting. It is really quite interesting how easily you can manipulate raster data with simple code and produce a result that would take longer in my opinion using ArcMap. The following is a result of analysis from the lab that was carried out strictly through Python script.
For a little background we were able to carry out slope and aspect analysis to produce a raster with ideal areas (in green) that met our parameters.

Tuesday, July 17, 2018

GIS Programming Module 8

This week in the lab we practiced pulling data from shapefiles and writing it in .txt files on Notepad for example. The process also works in reverse where you can pull information from a .txt document and populate shapefile attribute data. The results are shown below. The goal was to pull attribute data out of a shapefile and print it into a .txt file in a configuration that was readable.
The following pseudocode was used to accomplish the process. I am not including the actual code for obvious reasons, but this should show the overarching thought process behind populating a .txt file from attribute data.
START
Modules and Classes imported
Workspace set
Overwrite settings changed to overwrite existing files
Working shapefile variable set
Search Cursor used to select FID, Shape, and NAME attributes
Text document created for data to be written in
Iteration through rows started
    Vertex variable created, set to 0
    Iteration through arrays and points started
          Vertex variable changed to add 1
          Variable created as a string of text to write to file
                Result printed in Interactive window to error check
                Data written to .txt file
Text file closed
Variables row and cursor are deleted
END

Wednesday, July 11, 2018

GIS Programming Module 7

This assignment had some difficult steps and some that were fairly simple. The biggest issue I had with the assignment was the instructions outlined by steps. Some had excellent instructions on how to accomplish each step while others simply offered a solution, but did not really explain how the solution would work to accomplish the task. For example adding the variables from the cursor to the newly created dictionary threw me for a loop (pun intended). I spent two days trying to figure this out. Finally I reverted back to working with lists and for loops and realized the step was far simpler than I originally thought. The only other issue I had when working with the script was figuring out how the assignment wanted the results displayed on the window. Spaces or no spaces? Message data or not and for which steps? I understand the goal is to get us to work with the scripts and accomplish different tasks for different steps, but the instructions for the results display were set in different locations on the assignment and it took reading the document multiple times and re-scripting to come to a sensible conclusion that still could be interpreted as incorrect according to the instructions and example. A clearer reference should be used as to what result is required for steps 9-11.


Wednesday, June 27, 2018

GIS Programming Module 6

The process for writing the script was fairly simple for this lab with the help of the syntax helper tools. First I created the comments for the script with correct naming conventions and dates. Second I started with importing arcpy and environment modules and setting the workspace to my folder as well as allowing overwriting in the environment. Now it was time to start running the tools. First the AddXY tool gave me issues due to the fact that the tool alters the original shapefile by adding the XY data directly to those attributes. To fix this following the syntax helper I added a line of code to create a copy of the shapefile prior to adding the data. This allowed me to keep the original in my data folder. Next I added the code to create the correct 1000 meter buffer around the locations. This tool was fairly easy to code and ran perfectly the first time. Finally the dissolve tool gave me issues due to the fact that it was a management tool rather than an analysis tool. Since I had not used the tool many times in the application I incorrectly had it coded as an analysis tool (arcpy.Dissolve_analysis). As you can imagine the error code that was generated threw me for a loop. After a while of troubleshooting I realized the simple mistake and fixed the code allowing it to run properly.  To finish the code I added the print statements after all of the tools to print the correct data for the deliverable.