Posts

Showing posts from May, 2023

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...