Friday, July 25, 2014

GIS Programming Module 9: Debugging

For this week's assignment, we were given three scripts and had to debug and handle the errors in each of them. For the first two, we just had to locate the errors and modify the script so it ran correctly. This was a bit tedious, working through each line, but wasn't too horrible. 

For the third script, we just had to make it run by adding try-except statements to it. After a little trial and error, I managed to get it to work without too much stress. 

This was a surprisingly fun exercise. After getting my undergrad in journalism, I really enjoy reading/editing things. While this is a bit different, it was the same principle so I made the best of it. 

Here's the results from each script:




Friday, July 18, 2014

Module 8: Working with Rasters

For this week's assignment, we were to create a new raster from the data provided. This new raster was to highlight the areas that had forest landcover at 41, 42, and 42, slope between 5 and 20 degrees, and aspect between 150 and 270 degrees.

After working through the exercise, this assignment was pretty painless and stress-free. This is an image of my final product:


Friday, July 11, 2014

Module 7 GIS Programming

For this week's assignment, we were to write a script that created a text file and write it to the coordinates and OIDs for all of the features within the rivers shapefile that was provided.
Other than the usual setbacks, minor syntax errors and so on, this assignment went well up until the end. When I opened the new .txt file, all of the information was there, however, there weren't new lines for each feature. I messed around with PythonWin trying to figure it out until I ran out of time. Perhaps I kept overlooking something? This was my result in the text file:


Thursday, June 19, 2014

Module 5: Geoprocessing Using Python

This week's assignment familiarized us with running geoprocessing tools in Python. This one went much smoother than last week's, and was pretty enjoyable to work through. 
For the assignment, we were to take the hospitals.shp layer from the Data folder and first write a script that added XY coordinates to it. Then we were to create a 1000' buffer on it, and from there, dissolve the buffer into a single feature. It's a little tedious making sure every part of the script is correct, but overall, this one was a fun learning experience. Here are the results of my script:


Friday, June 13, 2014

Module 4: Python Fundamentals Part II

This week's assignment was a rough go. It started out simple enough, in the first two steps we were to import a random module and then find and correct two errors in a loop that was already written.
Then in step 3 we were to create a 'while' loop that added 20 random numbers to a blank list. This is where it got tough. After two days of trial and error and intense reading and rereading, I finally got it. Then it was on to step 4, where we were to write a code that created an unlucky number and removed it from the list. This was also tricky, but not quite as time consuming as step three. This was my final result:


Friday, June 6, 2014

GIS Programming Module 3

In this week's lab, the assignment was to write a script using our entire name. It started with a string, and from there we were to split, index, and use math functions to ultimately figure out the number of characters in our last name, multiplied by three.

Although it took me two attempts to get it to work in PythonWin, it was a fairly easy assignment. Here is a screenshot of my finished product:


Friday, May 30, 2014

GIS Programming Module 2

For this week's lab, we first built a model, then created a script tool from the model. Being relatively new to all of this, I found it rather tedious as first, but was able to grasp it fairly reasonably.
Building the model wasn't too bad, the only real obstacle I encountered was the SQL for the Select tool, mainly because I just kept skipping over it. Modifying the script took some time, because just any extra space or capital letter can throw the entire thing off. It just takes extreme diligence.
As tedious as the project was, it was very rewarding and satisfying to finally finish it.

Here is the map that came from running the script in ArcMap: