Friday, June 12, 2015

Discussion Post 1

Our first discussion in GIS Programming is about the uses of GIS in the real world. To facilitate our discussion, we were to find an article showing just about any interesting application of GIS - not necessarily limited to Python programming. My article focused on the use least-cost path analysis to assist in determining the route of Hernando de Soto's 1540 entrada:
http://saa.publisher.ingentaconnect.com/content/saa/aa/2015/00000080/00000001/art00003

The researchers wanted the optimal path to take into account the size of the party traveling that path. As pointed out in their article, optimal paths use slope information to find the best route and so the default best route is almost always along a flat area. Within the area under consideration that would mean that the best route will tend to be along canyon bottoms - which isn't appropriate when trying to determine where a large party of over 100 people, plus livestock and supplies, would be traveling. To fix this they 'degraded' the spatial resolution of a DEM (specifically a DEM from the 2000 U. S. Shuttle Endeavor with a 90 meter resolution) - this did not affect the accuracy of the DEM but did eliminate the default canyon bottom choice (p.50). In the end their preferred route was a wide northerly path that was a bit longer distance-wise, but it does match with accounts from the travelers themselves, as well as archaeological and linguistic place-name evidence.

Overall I liked that the article used GIS as one tool (out of many) to answer an unresolved question, and also that the traditional parameters of a cost-path analysis were changed to fit a specific project need. The article shows just one of the many ways GIS analysis can be used to answer spatially related research questions.

Reference:
Sampeck, Kathryn, and Jonathan Thayn, Howard H. Earnest, Jr.
2015     Geographic Information System Modeling of de Soto's Route from Joara to Chiaha:     Archaeology and Anthropology of Southeastern Road Networks in the Sixteenth Century.  American Antiquity (80) 1: 46 - 66.





Monday, June 8, 2015

Lab 3 - Watershed Analysis

This week in GIS Applications we covered the topic of watershed analysis. The analysis itself requires a lot of steps, although thankfully they are fairly intuitive and standardized.

Our final map output for this week shows a comparison of a modeled watershed and the actual limits of a defined watershed - for my lab example I had focused on an area of the Anahola Stream Watershed, on Kuauai Island, Hawaii.

View of a modeled watershed versus reality.

To create my model I selected a pour point location along a stream on the edge of my DEM (shown above as the 'landscape' underneath the main map elements). I then ran the watershed analysis tool (which can be found in ArcToolbox under Spatial Analysis > Hydrology). My input layer was a previously created raster file which showed the flow direction for all stream segments as well as my selected pour point. The result was a raster file showing the watershed extent in light green above - although for display and analysis purposes I had converted the raster to a polygon file.

What is striking is how much smaller my modeled watershed is in comparison to the extent of the actual Anahola Stream Watershed. Note that only the connected stream segments are shown within my modeled watershed extent. I believe that my watershed extent is directly due to my choice of pour point location... in fact the watershed area would be even smaller had I selected a pour point further upstream.

Friday, June 5, 2015

Module 3 - Python Fundamentals Part II

This week we finished up our scripting basics with a lab that involved debugging a previously written code as well as adding new code ourselves.

Screenshot of code results.
The first part of the code was previously written for the lab - it is a play by play loop (of if, then, else statements) for a dice game. We were to remove the two errors in the code in order for it to run correctly. The screenshot makes it appear random, but after running the code dozens of times I can honestly say it is not. Computer gamblers beware!

After the line 'Marceline wins!' is a list of numbers - this is the result of the first block of code that I had written for the lab. This line of numbers was randomly generated from 1 to 10, but repeated up to 20 times. The code used is known as a loop, and it utilized a 'while' loop structure to obtain the results.

The last three lines of the results represent my final block of code. The first line explains that I'm removing "unlucky number 3" from the previous list of numbers. The next line shows that the number 3 had been removed, and the final line indicates that the number is no longer present. This was all accomplished using methods (such as the remove function) and conditional for statements.

It was a little tricky for me to put this all together... which is a bit disheartening since I did understand the readings. Clearly learning and doing are two very different things!

Tuesday, June 2, 2015

Lab 2 - Least-Cost Path and Corridor Analysis

This week's lab focused on determining the least-cost paths and creating corridors using cost distance surfaces. The map layout below shows the result of a corridor analysis of black bear movement between two green zones, in this case Coronado National Forest.


View of possible bear routes between forested areas.


To run the analysis a cost surface was created - first by converting all vector data to raster, then by reclassifying the values of the input data. The cost surface inputs included the distances from roads, ranges of elevation, and types of land cover. Each cost surface was classified, and all cost surfaces were then added together using the Weighted Overlay tool. The weighted overlay results were then inverted using the Minus tool, since in our model the higher values actually represent the more desirable areas for black bears to travel within. Once complete the Cost Distance tool was run twice - one for each 'source' location. These results were then used as the input values for the Corridor tool.

Other Thoughts

This lab was actually very difficult for me - I kept hitting all kinds metaphorical walls until I finally realized what small random misstep I had taken. And the missteps were small - for example I had trouble getting my weighted overlay results to show something other than linear-like features. It wasn't until I really thought about what the data was meant to represent before it clicked what the problem was (in my case, the roads needed to show a range of distances... and to do that one needed to run the Euclidean Distance tool before running the Weighted Overlay!). Overall it was a learning experience as I believe I've gained some very useful knowledge on what it takes to complete a corridor analysis.

Friday, May 29, 2015

Module 2 - Python Fundamentals Part 1


This week we created a basic script, the end of result of which shows my last name and the number of letters in my last name times three.

To write the script I first had to define what my name was... this then was split into a list. From this I was then able to separate out my last name, and derive the total count of letters in my last name using the len function. Once I had this information I was able to write a statement multiplying the total last name letter count - the results of which you can see below.

The script, while short, was really the result of several false starts. After reviewing the textbook and the lab exercise several times I was able to finally produce something that should work with names other than mine, and can actually be run in PythonWin. This was quite the learning experience, and I am very happy with my results.
Screenshot of script results.





























Monday, May 25, 2015

Lab 1 - Suitability Analysis

The first official lab of the class involved running suitability analysis models. First we focused on simple Boolean analysis (models that answer yes/no type questions), then we covered weighted overlays (applying a ranking to possible suitability results).

Two weighted overlay results.

Discussion

The above map shows the results of two different weighted overlay results. Both maps were derived from the same input data (ranked highway, river, slope, soil, and landcover type) but the overall importance each dataset was weighted differently using the Weighted Overlay tool. The map on the left shows the model results if all criteria are given the same weight (in this case, each criteria weighted 20% out of 100), and the map on the right shows the results where some criteria (such as slope at 40%) are given more weight than others (such as roads at 10%).

As you can see, with the variable weight scenario map on the right the resulting classes were not enough to fill all 5 categories. What the category range means is that areas classed as being 1 are least suited (in terms of the overall criteria and their given weights) and areas classed as being 5 are most suited. Under the alternative scenario the best results are average suitable locations only.

Quite a bit of data processing went into the production of the above maps. The above maps show raster data, not vector data - so those layers that were shapefiles were converted using Euclidean Distance, then reclassified to show the desired number of classes/rankings. The raster data was also reclassified the same way.

A benefit of the weighted overlay over simple Boolean analysis is that one can see the shades of gray within the data... although as shown on the map above, it does matter how you initially class and rank your data. The results of a Boolean analysis are very easy to interpret but weighted overlays are a whole other beast - the above results are a bit trickier to understand, and a solid methodology is required to make sense of it all.

Sunday, May 17, 2015

Module 1 - Introducing Python

This blog submission marks the start of a new semester and a new class within the UWF GIS Certificate program! For the first module in GIS Programming we ran a Python script.

The purpose of the script was to set up all our folders and sub-folders for the semester, which it did in the blink of an eye. I had double-clicked on the script which ran it immediately - that was something of a mistake on my part, as I had meant to only open the file for viewing/editing. Oops. The script results are shown below.

What scripting can do for you - above is the Module 1 script results.
Once I opened the script I observed some variables I was able to understand right away (like "import os" or "course folder = [location for folders]"). Others, like "def createPath (path):" I'm not so sure on... but I can hazard a guess as to what that's getting at (and that probably is a definition of some kind). The formatting of the script is also a bit more complex than the pseudocode examples we had played around with in the lecture part of the class.

Overall this looks to be an interesting course - I've already picked up little knowledge nuggets, and I'm pleasantly surprised at how seemingly easy scripting can be.