Wednesday, May 25, 2016

Programming: Module 2

The lab for module 2 introduced object types, performing math functions, use condition statements, and use methods.  Through the exercise, it was clear to see different types of objects are able to perform certain actions.  It was easy to see how math functions and condition statements in scripts.

Module 2 exercise was to use my full name and assign variables to get certain results. I named my name and split my first and last name.  I assigned the split name a new variable.  To print just my last name, I used listName[1].  Using the function len, with the split on my last name counted how many letters are in my last name.  After assigning the count of letters a variable, I used a math function to calculate 3 multiplied by the number of letters in my last name.  I then printed the last variable.

This screenshot shows the results of the script.  Each result is built on top of the other.  My full name is split, my last name is printed, then the number of letters in my last name, and finally number of letters times 3.

Script Results

Lab 1: Applications in GIS

Lab 1 introduced suitability modeling with raster and vector analysis tools.  After using the tools, I compared the different approaches used.  Another key part of the lab was to adjust parameters to see how it can affect the output.

To create this map, I reclassified the land cover shapefile.  I also reclassified the soil shapefile.  Next, I created a slope raster with the elevation layer with a suitability rating of 1-5.  I used Euclidean distance to create a 1000 distance around the streams and also used the Euclidean distance tool to create a distance to roads raster.  This was broken into 5 classes using the 1-5 suitability rating.  After the suitability rating was applied to all the layers, I used the weighted overlay tool twice.  The first time, I used equal intervals.  The second time, I used different variables for soil, slope, streams, and roads.

It is clear to see how added more weight to a criteria can influence suitable area.  To see how much area was the most suitable, I change the layer to polygons and calculated the geometry.


Suitability Modeling

Tuesday, May 17, 2016

Programming: Module 1

This week's lab introduced how to use Python IDLE and PythonWin.  It focused on looking at the syntax, and how to write pseudocode code.  Another part of the lab was to practice running scripts.

The script I was created 12 module folders.  Within each folder, 3 sub folders were created: data, results, and scripts.  After running the script, it is clear how much more efficient.

Used Script to Create Folders

To run the script to create all the folders, I found the saved script.  I had to right click and select edit in PythonWin.  PyhtonWin is an IDE that allows for me to run a script in a window and also save thet script in another.  The comments before each section helped explain what the script would do.  I select the "Run" button to run the script and all the folders were created under GIS Programming.  I am interested to learn to build other queries like this to help me in school and work.