Posts

Showing posts with the label GIS 5103- GIS Programming

Module 6 - Working with Rasters

Image
For the final laboratory assignment of this course, I created a comprehensive raster image, consisting of five other raster images I had curated with specific conditions. The flowchart below demonstrates my steps for accomplishing this task, including checking-in/out the spatial analyst module, using the RemapValue, Raster, Slope, and Aspect functions, and saving my final raster image. These were all relatively new concepts for the course and I enjoyed using them to accomplish the goal of this assignment. My script output in the IDE included the print statements explaining what each step involved and the final raster matched the one included in the lab instructions, verifying the script ran successfully. I had the most difficulty completing step 3e of the lab. This step involved slope and aspect calculations using map algebra. I struggled with naming all used variables in previous code and then formatting the syntax so that the code would run successfully. After consulting with va...

Module 5 - Working with Geometries

Image
This week's laboratory assignment involved writing a code that creates a blank txt file and a Search Cursor that  runs through all River shapefile geometries. This data from the cursor is then populated into the txt file using a series of nested for loops and is printed to ensure it is accurate and includes all required fields. I enjoyed working through this lab assignment and have become skilled at determining what an error code is trying to tell me and how to resolve my code to allow it to run properly. Below I have included the Pseudocode and flowchart for the script I wrote for this lab assignment, both of which highlight the basic elements of the raw code. I also included screenshots of the output generated in the Spyder IDE for this code as well as the txt output file. The script output and txt file matching ensures that the txt file was successfully written and that my arguments were correct. This week’s lab involved the usage of a nested for loop, in which I was previo...

Module 4 - Exploring and Manipulating Data

Image
  Data Manipulation Script Code Output Data Manipulation Script Flowchart The script I created for this week's laboratory assignment demonstrates an understanding of how one   may explore and manipulate data, specifically spatial data in this instance. It involves creating a geodatabase, copying features into it, finding the county seat cities in a feature class using a Search Cursor, and populating/printing a dictionary. I enjoyed learning how to use a variety of new methods to accomplish tasks that are vital in organizing and understanding spatial data. This was certainly a more self-directed laboratory assignment, involving a great amount of problem-solving and backtracking to ensure the code would run smoothly. The Search Cursor syntax had made perfect sense while navigating through the readings and lecture materials. However, when working on the lab assignment, I found that there are many important rules one must follow to ensure the cursor runs correc...

Module 3 - Geoprocessing

Image
  Geoprocessing Script Code Output Geoprocessing Script Flowchart For this week's laboratory assignment, I created a script that would conduct three geoprocessing tasks.  The first task adds XY coordinates to the hospitals shapefile by utilizing the AddXY_management tool. The next task creates a 1000 meter buffer around the hospitals using the Buffer_analysis tool. The last dissolves this created buffer to create one single shapefile. GetMessages() was used to print the geoprocessing messages throughout, which shows their runtime and confirms the tools ran successfully.  First and foremost, I discovered that most geoprocessing scripts (and scripts in general) involve a few essential elements to get started. I usually like to complete the comments at the top of the script to display my name, script name, and script details. Then I complete a flowchart to showcase the elements of the script and organize it so that it will be easy to follow along while creating the script. A...

Module 2 - Debugging and Error Handling

Image
This second laboratory assignment of the course focused on using debugging techniques to correct pre-written codes so that they would run properly. I was able to use critical thinking skills and the debugging skills on Spyder to resolve the errors placed throughout the codes.  For the first two parts of this assignment, I found a wealth of syntax and small grammatical errors in the code that resulted in it not being able to run properly. I utilized the debugger and other helpful features offered by Spyder. The debugger can be used to help identify errors by running through code line-by-line, ensuring no errors are found and that all variables are being tracked. The debugger works by manually setting “breakpoints”, or places in the code that can serve as stopping grounds to make sure the code prior to it runs smoothly. Then, the debugger will go through each set of code between breakpoints, allowing one to check for/fix errors and keep track of variables to ensure the code runs prop...

Module 1 - Python Fundamentals

Image
  Code Output from Lab 1 Components Commence GIS Programming! This introductory module focused on the basics of the Python programming language and programming functionalities within GIS software. I am very excited to gain a better handle on Python throughout this course, as I am well aware of its usefulness in a variety of positions and tasks.  This week's laboratory assignment consisted of four separate parts that all utilized various elements of the Python language.  For part one , we were tasked with assigning our name to a list and then separating the first and last name, and then printing our last name. I found this to be the easiest portion of the assignment and had relative ease using the necessary function to separate my name.  The second task involved resolving a pre-written code's errors to get the code to run. For this part, I combed through the code with a fine-tip comb, seeking for any and all errors that would result in the code not being able to run...