Posts

Showing posts from May, 2024

GIS Programming Week 2

Image
This week, I learned the fundamentals of Python. I used what I learned to correct a script supplied to me, and to write my own. I corrected a script that simulates a game of dice played amongst friends, and wrote a script that displays my name and generates a list of 20 random numbers between 0 and 10. It then removes all instances of the number '7' and reprints the list. I wrote my code for this lab in Python IDLE, as I felt it was the easiest to approach. Messing around with the code and syntax, seeing what works and what doesn’t, was a great exercise that helped me understand the Python language and scripting more clearly. I had only a few troubles, mostly syntax errors that were quickly fixed. It was very satisfying finally getting a line to work after many failed attempts. An example of a mistake I had to troubleshoot was when I established the number ‘7’ as the variable to be removed from the list. I used an if or else clause to determine if ‘7’ showed up in the list and ...

GIS Programming Week 1

Image
This week I started my GIS Programming course, focused around the Python language. Python is an interpreted language, meaning the code is read and translated line by line, which makes it easy to work with but slower to execute. This contrasts with a compiled language, which requires the code to be translated and compiled into binary for the computer to understand. I familiarized myself with IDLE (Integrated Development and Learning Environment), a tool used to write and run Python, and ran a code provided to me to create working folders for the course. I learned while trying to run the file “CreateModFolders.py” from IDLE that it would not open if I just typed the file name, I had to manually search for it and select it for it to open properly. I learned about the use of flow charts in coding, and just like in previous GIS applications, they are used to plan out problems. I was then tasked with creating a flow chart of the actions needed to solve for degrees = radians*180/pi" for ...