Monday, June 2, 2025

Module 3: Debugging and Error Handling

 Module 3: Debugging and Error Handling

In this weeks module the focus was on how to debug code and understand what the error messages are saying to the person writing or using scripts. There are different errors that can be seen when writing script. The first common error message is syntax error as known as the "grammar" of the code. This includes the spelling, punctuation, and indentation. On the other hand there are run-time errors that come up after the code gets run. Some examples are NameError, TypeError, and LicenseError. When doing this week we did three different scripts that we either fixed or did a try-except statment.

In the first script we had to look for two errors that were within the code. When trying to figure out the errors you can either click the "Run Module" or "Check Module" within IDLE. For me the easiest one was to save the script and clicking "Run Module". Then it comes out saying what the error is and what line it is located on. The first error was a NameError that within Line 5 the name 'fc' is not defined. When looking at the rest of the code it showed that the name 'fc' needed to be capitalized. The second error was another NameError in Line 8 where the name 'field' was not defined. Once again looking at the rest of the script I was able to notice I needed to add an 's' to the end to match other portions of the script. The picture below is the output of the script that was written.


The second script there were several errors or exceptions. Once again it was easy to save the script and click "Run Module" to find the first error. The first error was a NameError in Line 6 that indicated 'Filepath' is not defined. When looking in the rest of the code you can see it needed to be 'filepath' in the parenthesis. Next was an OSError which indicates that the file path in Line 6 is not connected to anything on the computer. I fixed the OSError to filepath ="S:/GISProgramming/Module3/Data/ Mod3_Data/TravisCountyAustinTX.aprx". The next error was a NameError in Line 8 saying 'arcp' is not defined and I noticed it was the dataset 'arcpy' that needed to fixed. Afterwards there was another OSError found in Line 7 and noticed one of the slashes were in the wrong way and that I needed to add more to the dataset file path. Then the next error was AttributeError that says 'spatialRefernce" does not exist. All I had to do was spell it correctly as "spatialReference." The next error was a TypeError that says 'type' object is not iterable in Line 13 and all I needed to do is add a 's' to the end of map. After fixing all the errors and exceptions it finally produced the outcome of the spatial reference and the four shapefiles within the ArcGIS Pro map which is seen in the picture below.


The third and final script that was written had errors but we needed to do a try-except statement. This statement allows a script to run successfully which helps with seeing the exceptions within the code and “trap” it so the code can continue run. When including the try-except statement you want to run the code to see what the error is that is stopping the code from running. First you want to put “try” statement before the code that has the error(s). Next you want to then put the “except” statement below the error and handles the error. Then you will run the code again to see if there are any other errors in the code. If there is another error, you can include in the current “except” statement or make another. Lastly, when you have all the errors it should be able to run the code and explain to someone why there were some errors as well as where they were located. I have included the output of both the parts and a flow chart of how to do Part A of the try-except statement.


In this module it was very helpful to learn about the different errors so that in the future my script runs without issues. Also, if I do run into issues I can fix it easily by being able to read what the errors and fixing them. Lastly, learning how to do the try-except statement lets the code run even if there are some errors that you might not necessarily know how to fix at the moment.

Tuesday, May 27, 2025

Module 2: Python Fundamentals

 Module 2: Python Fundamentals

This weeks module was focused on the fundamentals of how to use Python within ArcGIS Pro. The focus was on using strings or text to write our names, fixing code that was previously written, writing loop statements, and removing numbers from previous generated code.

When doing string code it is important to put quotation marks around the words that you want to print. Also, when using string we tried indexing, where is the system of numbering a sequence of characters and can be used to fetch elements within a string. we are able to do this either through words in double quotation marks or lists with single quotation marks. Lists can be either be text or numbers. Lastly, I needed to just get my last name out of the list which is splicing. For this code the best way was to put -1 to get the last name out.

Next part of the module was fixing code that was already given to us. There were two errors that needed to be fixed and to start you want to run the code to see where the first problem was located. The first part that came up was that randint did not have the correct input. This code is considered a conditional statement and before it can run you need to import random before using random.randint. The second error was in the print portion of the code. It said that you cannot have both integers and strings in the print portion. So I needed to either make them all string or all integers. I had to do all string because the last portion could not be an integer. I had to put the integers in str() to get the code to work properly. After fixing that portion of the code it worked and showed the statement for each of the players.

The next portion of the code was creating a while loop statement. We were supposed to create a loop that creates 20 random numbers between 0-10. This code is similar to the one that was given to us but we needed to make sure the statement was empty and that the counter is 0. The while loop is based off a condition that was given to the code which was less than 20. Once again I needed to import random so that I could create random.randint (0, 10). In order to get the random numbers printed I needed to use the code .append(). Also, to make sure the code does not do it continuously and actually produces the numbers you need to add break before the print portion of the code.

Lastly, the last portion of the code was to chose a number that was going to be removed from the previous list that was generated. I used a for loop statement so I could get the if-else statement to determine if the number was in the generated list. Lastly, in this portion I had to use .remove() to get the number taken out of the generated list. It is important to note that the numbers are taken out of the list is done one at a time. The picture below shows the answers for all the code that was written.


Throughout all the different portions of the code there were some things that I learned which were make sure before running the loop structures code that you have a stop (break) statement. I did not have that and it caused ArcGIS Pro to crash and I had to close out of everything before I could get the code to run again. Also, make sure to do the exercise before anything and take notes that you can reference when doing the module. When doing steps 3 and 4 I needed to make sure that step 4 linked back to step 3 so that the numbers were connected. Lastly, when the numbers are being removed it is done one at a time. I think if you wanted all the numbers to be taken away at once it would be good to use the delete function.

This is the flowchart of the script that was written.



Saturday, May 17, 2025

Module 1: Python Environments and Flowcharts

 Module 1: Python Environments and Flowcharts

In this weeks lab we were learning about the basics of Python, Flowcharts, and create file paths for our work for the next 8 weeks.

Python is a programming language that is both simple and powerful. This is important because it makes it easy to learn compared to other programs, such as C++. Also, Python is considered interpreted which means that Python is interpreted or “interacted” during the time the script is being run. This is important because you can create the script you want, and it will immediately interact with Python. Also, it means it does not need compilation to binary code before you run it. Which means you can run the program directly from the source code. When using Python there are two ways you can write code that can interact with ArcGIS Pro, which are Integrated DeveLopment Environment (IDLE) and Notebooks. The difference between IDLE and ArcGIS Notebooks is that IDLE indirectly interacts with Python whereas ArcGIS Notebooks directly interacts with Python. Also, Notebooks can contain more than just code and can contain regular text, images, external links, and other elements. Whereas, IDLE contains only code and regular text that are comments. The two Python tools share in common are when you create and write script it will interact with the Python Command Prompt. Also, if you right-click on Python script you can edit IDLE within ArcGIS Pro which you can do with Notebooks.

Another aspect that we learned this week was Flowcharts, which uses symbols and shapes to represent an algorithm. This algorithm is created before it is put into Python to write the script. The symbols that are used for flowcharts comes from reading by Agarwal et al. (2010). Being able to know the common symbols is helpful because everyone will know what it being represented. This week we were supposed to make flowchart of a basic formula to convert radians to degrees, which is represented in the image below. This is important because it shows how you thought the script through before putting it into Python.



Lastly, in this weeks lab we were supposed to take an already written python script to create folders in our S: Drive for this class. First, I opened Python Command Prompt and typed in idle to open the idle interactive window. Second, within the IDLE window I opened CreateModFolders.py script. Third, it opened the script, but it did not immediately add the folders to my S Drive. I was confused at first and was not sure what to do next. That is when I went to the exercise and was able to figure out what I needed to do. Fourth, I went to the Run tab and clicked Run Module, and it opened that it was completed. Fifth, I opened the S Drive, and the folder was finally installed. Being able to work through the issues were important because I have not done Python before and it gave me an opportunity to learn more about the program.

Friday, May 2, 2025

Module 7: Google Earth

 Module 7: Google Earth

This weeks module is about using Google Earth and knowing how to show data through an interactive 3D map. One of the best things about Google Earth is that the data is free and can be used by everyone who is able to download the app on their computer. Much of the maps we created in this class are from ArcGIS Pro and using Google Earth is important to give data to the average person. 

It is important to note that the data that is used in Google Earth are KMZ/KML files. The data that is used in ArcGIS Pro are either feature classes or layers. The first step before using Google Earth is converting the data to KMZ/KML files. Once the data is converted it can be opened up in Google Earth. Also, in this module we learned how to use a png or jpeg file to image overlay the image onto the map. For this map it was a legend and we need to make sure the colors in the legend matched the colors on the map before getting converted to KMZ/KML files. The map below showed how all the data is able to be put within Google Earth and give it easily to other people who have Google Earth on their computer. The reason that is important is because ArcGIS Pro is expensive and people cannot always use that data to make maps in the future.


In the module we were able to learn how to create a Google Earth Tour to show all the information of the dot density map and the landscape. First we needed to create placemarks in dense areas in southern Florida, such as Miami, Fort Lauderdale, Tampa Bay, and St. Petersburg. To make the video we needed to turn off the names of the placemarks but could still use it for the 3D tour. A pro for using Google Earth is that there are some areas that were more photorealistic because there had been more data collected. An example is how Tampa looks more photorealistic because it is using LiDAR data whereas Fort Lauderdale was likely manually put in and does not look as realistic. In order to make the Tour you need to press the "Record a Tour" button and make sure to press the red record button. To zoom into the placemark areas you need to double-click the placemark and it will zoom into that area. When done you need to press the red record button again to stop the tour. When you save the tour you need to make sure to save as a kmz file so that it can be given to anyone with Google Earth on there computer.

This module is very important to learn because the data can be given to people who have Google Earth on their computer. Also, Google Earth is free and people are able to get a lot of information without having to pay a lot of money. Since ArcGIS Pro is very expensive, Google Earth is definitely a cheaper option.

Saturday, April 26, 2025

Module 6: Isarithmic Mapping

 Module 6: Isarithmic Mapping

This weeks module the focus is on isarithmic mapping and how to present the data for the map reader to understand without much explanation. The isarithmic map is probably the most widely used thematic mapping method, and is also one of the oldest techniques, dating back to the 18th century, after the choropleth map. Isometric maps depict smooth, continuous phenomena, such as rainfall, barometric pressure, and topography or elevation. The most common form are contour lines.

The isarithmic map below is showing the annual precipitation over a 30-year period (1981-2010) by different techniques of continuous tone, hypsometric tinting, and contours lines. When making the map the first thing that needed to be done is creating the continuous tone. The continuous tone symbology refers to the representation of data values using a continuous range of colors or shades. The way this is implemented in the map is the symbology is of the average annual precipitation across the state of Washington for the years of 1981-2010. Also, on the continuous tone map we added in the hillshade effect to indicate the steep areas more effectively. This is important because we are able to show a 3-D view of the more mountainous areas compared to the flatter areas. Hypsometric tinting uses colors to represent elevation zones across the map. This was implemented on the map by using the data of the annual precipitation and changing the color ranges with equal to or less than 10 being red (lowest number) to greater than 180 (highest number). Contour lines are also a useful surface representation, because they allow you to simultaneously visualize flat and steep areas by the distance between contours, as well as and ridges and valleys by converging and diverging polylines. When using data it is important to understand where it is coming from and how it is collected. The way the precipitation data was derived and interpolated through PRISM, which is an analytical model that uses point data. Also, has an underlying grid of digital elevation model (DEM). This was used to generate a 30-year climate average through the years of 1981-2010 to get gridded estimates of monthly and yearly precipitation and temperature at 800 meters spacing. Lastly, on this map there is a paragraph to help the map reader understand how the information was collected and interpolated for the isarithmic map.



Sunday, April 20, 2025

Module 5: Choropleth and Proportional Symbol Mapping

 Module 5: Choropleth and Proportional Symbol Mapping

In this weeks module we learned about choropleth map, proportional symbols, and graduated symbols. Also, we learned about different projections for the choropleth map and which ones would be the best to not cause any distortions on the map. Lastly, we learned the best way to present the data so that all map readers could understand and see the map.

Choropleth maps are a thematic map in which enumeration units are shaded by intensity proportional to the data values associated with those units. The reason one would use a choropleth map is when data is distributed evenly within a boundary. Also, when doing a choropleth map the best way to use it is with standardized data that can be represented easily. One limitation with a choropleth map is that there is no variation within one enumeration unit. When doing a choropleth map it is important to look at the data that is given to make sure there are no outliers that could skew the data to one way or another. At the same time, the cartographer needs to know if they want to class the data and which classification they would like to use. Another aspect of the choropleth map is the color scheme and which one to use. Cynthia Brewer, the creator of ColorBrewer, wanted to figure out color schemes and how they are interpreted. Also, she talked about how data presented determines color schemes, such as unipolar data, bipolar data, and balanced data. Unipolar data is where data has no natural dividing points and should be represented by sequential steps in lightness or a sequential scheme. Bipolar data is data that does have a natural diving point and would use a diverging color scheme. This is where two sequential themes running end to end with the lightest color in the middle. Balanced data is data that represents two complementary coexisting phenomenon with a bivariate or diverging color scheme should be used. Another important aspect when thinking about what color to use for choropleth maps is about people who are colorblind. Even though they make up 4% of the population it helps the cartographer remember that using colors of red or green could make it hard for the map reader to know what the data is indicating. The best projection to use for choropleth maps is Albers because it makes sure the geographic region is not distorted. Lastly, when making a choropleth map the legend is important to show how the data is being represented. When looking at the map the cartographer needs to figure out if the legend needs to be horizontal or vertical. Also, the legend needs to contiguous as opposed to being separated by spaces. 

The next portion of the module is presenting data either through proportional or graduated symbols. The symbols are a method of mapping that uses visuals of sizes to represent differences in the data. The differences between the two symbols are either class or unclassed data. Graduated symbols is when you class your data. Whereas, proportional symbols is when the data is unclassed and the symbols are proportional to the values of the attribute being mapped. There are different types of symbols that can be used on proportional maps. The first type is geometric symbol (i.e. circle, square, triangle) and is most commonly used. Another type is pictograph symbol where the cartographer uses an actual picture to represent the data but can be hard to interpret on the map by size. The third type is a column map where the height of each column is proportional to the data values, but it can be hard to see the smaller values within the map. A final type is 3D symbol that can be eye-catching but hard for map readers to gauge the symbol size and value. When creating proportional maps the most common issue is symbol overlapping. Making sure there is not too much overlap or too little overlap is important to make sure data values are on the map. One way this can be done is by making the symbols either transparent or opaque. Transparent symbols make it possible to see through overlapping symbols. Whereas, opaque symbols can enhance figure ground contrast and make the symbols appear "above" other map information. Lastly, if an area is overcrowded the cartographer could use an inset map to get closer to the data values and help with overlap.

In this weeks map we used ArcGIS Pro to create a choropleth and proportional map on European population density and wine consumption. In the choropleth portion of the map I took the information that was given above to make the map in a way for the map reader to understand the data. First it was important to look at the map projection which was Albers. As stated earlier Albers is the best projection because it makes sure the geographic region is not distorted. Next I looked at the data to see if there were any outliers that would skew the data to one way or another. When trying to show the population density it is important to make sure the data is not raw but standardized because it takes into account square kilometers to the amount of people who live there. An example would be how Russia is massive but there might not be as many people per square kilometer. Another aspect I looked at was the color scheme to use which was a gradual light to dark blue. The reason I used blue was because it was a color many people liked and people who are colorblind are able to see the changes in color with less issues compared to red or green. Next when looking at the legend it was important to make sure the classes were not separated so the map reader to see the gradual change better. Lastly, I did an inset map because there was a portion that had a lot of circles overlapping which made it hard to see the countries and to know where the circles belonged on the map.

On the other hand, the proportional portion on the map is looking at the wine consumption of liters per capita. The method that I chose was graduated because it seemed to show the differences between the countries and wine consumption better than the proportional. Also, I chose graduated because there were ranges that could be shown in the legend unlike proportional where it is just the highest number of the range. Lastly, I chose graduated because you can do different classification methods to see the changes in wine consumption. I decided to use the green circle because it is easier to see on the blue background then other colors. In this legend I did smaller to bigger vertically because it is similar to the smaller numbers being up top for the population density. At the same time, there is map elements that needed to be put on the map such as the title, scale bar, north arrow, and map information. All of this is necessary because it helps the map reader to know what the map is showing, the size of the countries, which way is north, and who the cartographer is, the date it was created, the source of where the material came from, and the map projection. A new aspect was creating a subtext of the information that is shown on the map. Such as the lowest and highest amount of wine consumption within the countries. A subtext is able to give more information without overpowering the map reader with all the information that is given on the map.

While doing this module it took longer to get all the information on the map and make it look good to the map reader. When trying to get a lot of information across it is a fine line on knowing what needs to be said and what needs to be omitted. Also, when making maps it is important to note that not everyone will not like the map and try to make it to the masses. Lastly, before creating any map it is necessary to look at the data to figure out the best way represent the data to the map reader.

Sunday, April 13, 2025

Module 4: Data Classification

Module 4: Data Classification

In this weeks lab the focus was on the different data classification methods that can be used to represent data that are given to cartographers. The four classification methods that are common to use in ArcGIS Pro are Equal Interval, Quantile, Standard Deviation, and Natural Break. The Equal Interval classification method represents an equal amount of data values. The problem with the method is that there could be a class that contains no values and could be left blank. The Quantile classification method will never have empty classes or classes with few values. This method is good only if there are no outliers that can skew the data in one way or another. The Standard Deviation classification method is formed by adding/subtracting the standard deviation from the mean of your dataset. It is important to note that identical values cannot be in two different classes. A major disadvantage is that the data needs to be normally distributed to use the method. If the data is not normally distributed there could be classes that contain no values. The Natural Break classification method considers the natural groups within the dataset. Also, the method minimizes the differences between data values in the same class and maximizes the difference between classes. It is important to note that the method does consider outliers within the data and will place them in their own category. At the same time, it places clusters of data in one or more classes. Lastly, class breaks are up to the mapmaker with can make the map more subjective. Each one the classification methods have their advantages and disadvantages that the cartographer needs to make sure they are aware before representing the data.

There were two types of maps that are being represented in this weeks lab using the different classification methods. The first map is the percentage of people 65 and above in each of the census tracts. The classification method that best displays the data for an audience looking for is equal interval. The reason is because the classes are equal in their representation of the data. Also, it makes sure the outliers are not skewing the data in one way or another. Even though there are classes that do not have any data being represented it is still easy for the map reader to know what the census tracts represent. Lastly, the data is able to target the senior citizen population that has the highest amount of population in the census tracts.


The second map that is being represented is the population count normalized by area. This map is able to represent the actual numbers of the people 65 and above along with the area of the census tracts. When looking at the data being presented the map that accurately depicts the distribution of senior citizens is the Natural Breaks from the population count normalized by area. The reason for this is because it gives actual numbers and not a percentage of the population. Being able to see the actual numbers gives a better representation of the distribution of senior citizens. One potential issue of the other presentation method is that it is a percentage of the senior citizens compared to other age groups and not actual numbers. The numbers of senior citizens helps the map reader know how many actual people are in the census tract. Another potential issue is that the percentages are rounded to the second decimal point whereas the normalized group is either rounded to the first decimal point or a whole number. The last potential issue is that the numbers are based off the square miles of the census tracts and not just the percentage of the age group. Having the number relative to the area of the census tracts gives a better representation.


Data can be represented in many different ways and it is up to the cartographer to make sure it is being represented properly. The data can be represented by different classification methods such as Equal Interval, Natural Breaks, Quantile, or Standard Deviation. The cartographer has to make sure the data is not going to confuse the map reader or give them false interpretation of the data. Lastly, the cartographer needs to look at all the data before it is being represented to make sure they are not interpreting the information correctly.

Blog Post #5: GIS Portfolio

 Blog Post #5: GIS Portfolio In the final weeks for the GIS Internship we were given the task of creating a GIS portfolio either on paper or...