Sunday, May 31, 2015

Corridor & Cost Path Analysis

The cost of movement is usually something thought of in terms of money, in the context of shipment or transport.  Cost can take the form of a whole host of other factors, though, when it refers to some expenditure to move across a landscape.  We can express cost in terms of time, energy required, or even impact on the environment.  Anything that effects movement can be modeled as a cost, which can also be translated into a predictive measure, as in the case of corridor modeling and analysis.

  
The above is a map of the results of a corridor model for black bear movement between two disconnected portions of a National Forest.  The placement of the corridor was chosen in terms of an analysis of the elevation, land cover, and distance from roads- with its final size and position determined by the preferred habitat of the black bear.  Each cost, or factor affecting the bears' possible movement, was given a weight, and the GIS output was a predictive corridor between the two protected areas.  Possible movement of something as unpredictable as a wild animal can never be definitively plotted, but expanding a possible path into a corridor, with placement based on measurable factors, can provide a useful predictive tool.

Monday, May 25, 2015

Python Fundamentals, part I

This week we begin with the fundamentals of Python- how it is structured, and how it handles various types of data, like text, numbers, and lists.  Programming language, like communicative language, uses syntax, and the way various elements included are ordered and input makes the difference between a desired output and an angry red error message.



The output pictured above- my last name and the number 36- doesn't seem like much to produce, but the script used to create it took no small amount of effort.  It was not a simple "print" (to the screen) command to return those values, but rather a structured script that took my full name, put my first, middle and last names into a list, extracted my last name from the list, took the number of letters in my last name, and finally output that number times 3.  This process is completed in with Python script, using variable assignments, functions, methods and expressions.  It is a fairly basic procedure, and may seem a bit arbitrary, but the concepts learned and mastered therein are essential to the development of a decent working knowledge of Python.  It is upon these basic skills we build a greater understanding and mastery of the programming language.  

Sunday, May 24, 2015

Land Use Suitability Modeling

If you've ever taken the time to consider, for some location, why something is there, whether it be man-mad or naturally occurring, you may be able to understand why land use suitability analyses and models are done.  The particulars of how these are typically structured and carried out is our topic for this week.






The above is a comparison of two methods of suitability analysis, both performed on raster data, and both created using a weighted overlay process.  The weighted overlay model assigns a weighted relative value to each raster cell, the difference between the two maps above being the equal weights scenario assigns the same level of importance to each of the five input values, and the alternative scenario assigns a different percent weight to each.  Each cell's value in the final output is a result of combining the relative values of the five inputs, which were raster data indicating certain criteria- such as land cover, slope, distance from rivers and roads and type of soil.  The values of the input cells for each criteria were based on a 1 - 5 scale, with higher values representing locations more desirable, such as those nearer to rivers and with certain types of soil.  By combining the five weighted values for the input (criteria) rasters, an output composed of cells indicating the relative suitability of an area, based upon the desired criteria, can be produced for a location like the study area in the maps above.  

Sunday, May 17, 2015

An Introduction to Python & Computer Programming for GIS

A new semester, a new challenge- and this summer finds your humble blog author embarking on an endeavor to learn the basics of writing script for GIS with Python- ESRI's scripting language of choice for ArcGIS.  It is probably relevant to point out here that my prior experience with scripting in GIS, in its totality, involved listening to a particularly vocal co-worker complain about simple VBA operations for the version 9.2 ArcGIS we were using in those years, and I do recall him mentioning Python a few times as well.  Now (many years later) we are on ArcGIS version 10.2, and Python has been declared the victor in becoming the go-to script for automating various tasks in ArcGIS.

Python lists being open source and relatively simple/user-friendly among its advantages, and it is essential for any competent GIS professional to be at least familiar with its workings.  Even better, though, is to be at least somewhat well-versed in its use for automating geoprocessing tools, and that is the aim of this course.  We begin with learning the basics of opening the scripting and interaction windows in our Python editor- PythonWin.  From there we move on to becoming familiar with some of the basics on problem solving processes with scripts, and modeling with pseudocode and flowcharts.  Like any language, Python has its idiosyncratic ins and outs, and familiarity with some of their fundamentals is necessary as a start.



The above is a screenshot of a directory of folders that was created with a Python script.  The script was run, and the folders created, on the remote desktop that we use to access ArcGIS Desktop.  ESRI does, however, provide a free-of-charge, trial version of the software for students, good for one year.  Working on the remote desktop can be slow at times, especially on weekends when it seems that everyone in class is finishing their work, so it's often easier to use the software version run locally, without the remote connection.  The script provided for this week's exercise, that creates a directory of folders that will be used this semester, specifically references the drive used on the remote desktop connection though, and as-is must be run there to work.  Upon opening the script file in the PythonWin editor I found the specific line that does this with the simple command of "courseFolder = x:\xxx."  Running the script locally, on my laptop, I changed the location referenced (the "x"s in my example here) to the information for my personal hard drive, and ran the script there.  Lo and behold, it created the file directory (as in the screenshot above) right where I specified- on my computer.  This small triumph of successfully modifying provided code is to be savored, for the impression that these will be relatively rare this semester is rather striking.  Onward and upward we will continue though, on this exploration into the arcane and hallowed world of computer programming...