Posts

Module 4 GIS Programming: Geoprocessing

Image
        Hello all, the fourth week of GIS Programming (4102/5103) was an introduction to running geoprocessing tools using ModelBuilder in ArcGIS and a main focus on using Python scripts to run geoprocesses. The first thing to learn about using Python for GIS is to import arcpy and set your workspace to begin the code. Some main things to watch out for when using GIS tools in Python are things such as allowing outputs to be overwritten, using the correct syntax for the tools, making sure data exists, and assigning features to variables in the script. These can allow for the scripts to run smoother and without errors.      The first part of this assignment included using the Clip, Select, and Erase tools in ArcGIS using a ModelBuilder. The logic of the model was relatively simple and could erase the selected soil areas that were not prime for farming.      The second part of the assignment asked for the use of the AddXY, Buffer,...

Module 3 GIS Programming: Debugging and Error Handling

Image
     Hello all, the third week of GIS Programming (4102/5103) was to teach us how to debug code and handle errors within the code. The first main way to find errors in code is to check the module first to check for syntax errors. If a syntax error occurs, none of the code will even run because Python can not understand what was written. After finding potential syntax errors, runtime errors could be identified either by running the code to see the error message or by running a debug tool. I personally find it easier to run the code and see the error message but I understand that at times a debug tool would be very useful. We also learned of another way of handling errors to allow the script to run without necessarily fixing the problem. A try-except statement can capture an exception (or error) and allow the script to keep running without that part of the script. You can also use it to print the error that occurred, which can be helpful in fixing the error.    ...

Module 2 GIS Programming: Python Fundamentals

Image
      Hello all, the second week of GIS Programming (4102/5103) was focused on learning the fundamentals of Python. This included topics such as loops, formatting, lists, sets, and many other basic functions/methods used in Python scripting. As I've said before, the Zandbergen (2020) book helped a lot with figuring out how to do a lot of this. This week we were tasked first with creating a set of names and splitting it into a list. This was simple enough and was a good introduction to creating and indexing a list. The harder parts of the assignment were correcting the dice code and creating a randomly generated list using a while loop.  I've provided my results from the code down below:     The dice code had two errors, which took me longer than I expected to figure out. The first error was a syntax mistake in a print code that needed to be cast. The second error was simply a capitalized X instead of a lowercase x. I have included a flowchart of the logic b...

Module 1 GIS Programming: Python Environments and Flowcharts

Image
       Hello all, the first week of the Summer 2023 GIS Programming course (GIS4102/5103) at UWF was an introduction to basic Python, including its environments and some syntax, as well as the logic, principles, and design of flowcharts. Since I've had no prior coding experience, the first week was very daunting. However, taking my time to do some extra practice outside of the exercises and readings really helped quell those fears and prepare me for the work. I cannot recommend the   www.w3schools.com/python/   tutorial enough for beginners to understand Python. It is interactive, explanatory, and has exercises built in. I would also like to make note of the  Agarwal et. Al. (2010) reading for a good introduction to flowcharts, which helped me to create mine.      Module 1 introduced us to Python environments with a main focus on IDLE and ArcGIS Notebooks (integrated Jupyter Notebooks in ArcGIS). IDLE and ArcGIS are the same in that they...