Tuesday, May 28, 2024

GIS 5103 Module 2 - Python Fundamentals

 


Module 2 of GIS Programming was an opportunity to dive deeper into the fundamentals of Python script coding. We were introduced into the different object / data types, syntax, functions, methods, loops, and conditions. While I am no where near a Python expert, I am one hundred times more comfortable typing small scripts in IDLE and ArcGIS Pro. 

The assignment for this module was broken down into four parts, and then compiling those four parts into one Python script; the result of the script can be seen in the image above. 

The first part of the script was creating a string data type that consisted of our entire name, using the split method to divide our full name into its individual names, and to use indexing to print ONLY our last name to the output. This can be seen in the first line of the output [blue lettering]. This part of the assignment was very easy and did not present any issues.

The second part of the assignment was to troubleshoot a block of code that was provided. Essentially, the code is a dice game that takes a list of players, and each player tries to score higher than the number of letters in their name. For example, if a player's name is made up of four letters, they have to score a five to win, a four to tie, and anything lower than four is a loss. The errors found within this code were simple syntax errors that were easy to fix. The first issue was to import the random module, the second was concatenating an integer with a string data type [the solution is to temporarily convert the integer into a string], and the third was a case-sensitive typographical error. Once these errors were corrected, the game was run effortlessly. The results of the game can be viewed on lines two through seventeen of the output [blue lettering].

The third part of this assignment was to generate a list of twenty random numbers that lie within a range of zero to ten. This was accomplished by creating an empty list, generating random integers, and using the append method to add these random integers to the list. Also, a counter variable was defined that counted up by one each time an integer was added to the list. Once the counter equaled twenty, the loop was stopped by executing the break command. The result of this part of the script can be seen in the eighteenth line of the output above.

Finally, we were tasked with creating our own script that chose an 'unlucky' number and deleted it from the list created in step three. A conditional if statement was used to print a statement to the output; if the unlucky number was present, a message appears that states "Unlucky number [x] will be removed [y] number of times from the list." If the unlucky number was not present, a message appears that states "Unlucky number [x] did not appear in the list." Lastly, the remove method was executed to delete all instances of the unlucky number from the randomly generated list. The result can be viewed in the last two lines of the output. 

I am extremely pleased with the outcome of this script, and I look forward to expanding my knowledge base of this programming language.

Tuesday, May 21, 2024

GIS 5103 Module 1 - Intro to Python / Flowcharting


 Module 1 of GIS Programming was an introduction to the Python scripting language, which we will be utilizing this semester to automate geoprocessing tasks to make the workflow more efficient. The exercise and lab assignment for this module focused on opening the Integrated Development Environments [or IDE's], familiarizing ourselves with the interface, writing a couple one-line scripts, and importing / running a script that was written by another person. I was able to follow this code line-by-line with a moderate understanding of what was taking place, but the syntax of this language is completely new to me. Ultimately, the script created a file system on our personal S: drive for our files / data to be saved to throughout the remainder of the semester. It was really neat to just run a program that created all of these folders instantaneously. Manually, this process would have taken at least a few minutes opposed to the second it took to run the script. This was an excellent illustration of how Python scripts can be used to automate redundant and time-intensive tasks. 

The second half of this module's lab assignment was to create a flowchart of a script that would convert [3] radians to degrees and print the output. We did not actually write the code, but the process we would undertake if we were to write it in Python. Essentially, we used conventional symbology to begin / end the script [ovals are used for termination processes], define the variables such as radians [3] and Pi [3.14159] [rectangles are used for assignment and computational processes], print the output of the calculation [parallelograms are used for input / output processes], and terminate the script [oval shape again]. The flowchart for this script can be viewed in the picture above. 

I am highly excited to dive deeper into the Python programming language and use it to create a more efficient and streamlined workflow in ArcGIS. 

Thursday, May 2, 2024

GIS 5007 Module 7 - Google Earth

 


The final Module of GIS 5007L was an exercise that solely focused on Google Earth. Using ArcGIS Pro, we imported the data provided for this exercise and converted it into a KML [Keyhole Markup Language] file; this file type is mainly used in Google Earth to create interactive 3D maps. I use these functions almost daily at work because most of our clients do not utilize the same GIS software that our company does, and KML files can be viewed on any computer with Google Earth Pro installed [this program can be downloaded for free here].

As shown in the screenshot above, we created a dot density map of southern Florida that also featured some polygonal layers that illustrated the locations of many large lakes, marshes / swamps, and streams throughout the southern half of the state. The legend was provided as a JPG file, so I imported this image into ArcGIS prior to the KML conversion, and utilized the eyedropper tool to match the colors of the polygons to the colors in the legend perfectly. 

After the KML file was created, we added the legend to the screen so the map viewer can see it through the Google Earth interface. Per the lab instructions, we were to insert the legend as a graphic overlay; this essentially assigns it a geographic location and forms it against the surface of the Earth, causing some distortion within the legend. One of the student leaders offered some excellent advice on how to insert the legend as a screen overlay, which places it at a particular location on the screen [as opposed to a geographical location]. This gave the legend its original appearance and did not cause any distortion; I was very pleased with the outcome. 

The second half of the exercise was creating a 3D tour of southern Florida. In my tour, I begin with a global shot of Earth's western hemisphere and then it zooms into the southern Florida region, bringing up the layers of the KML created in the first half of the lab. Then, it zooms in further to the Miami metropolitan area, displaying Jupiter, Florida all the way south to Homestead, Florida. After this shot, the camera zooms into a 3D view of downtown Miami, and the layers / legend are removed from the screen. There is an orbit around the Miami central business district and then the camera flies over to Ft. Lauderdale, followed by an orbit of the central business district of this city. Next, the computer zooms back out to satellite view over the Tampa Bay metropolitan district [Layers / legend are turned on for this shot]. The camera then zooms back in to 3D view and orbits around Tampa Bay and then St. Petersburg before zooming back out to the entire southern Florida shot again. Finally, the computer zooms all the way back out to the original view of the global western hemisphere that began this 3D tour. Anyone that has Google Earth Pro installed on their computer can download and view the tour by clicking the link below; once the KML is loaded, just double click the '3d Tour' link in the pane on the left side of the screen [Make sure the 3D Buildings layer is turned on].


This lab assignment presented no major obstacles but was an enjoyable way to end this semester and a great opportunity to explore the capabilities of Google Earth that I do not get to utilize often. 

Thursday, April 25, 2024

GIS 5007 Module 6 - Isarithmic Mapping


 Module 6 of Cartography was based on Isarithmic Mapping. Isarithmic mapping differs from the other types of maps created in this course because it uses raster-based datasets. Raster-based datasets are pixel arrays, arranged in a grid pattern, where each pixel contains a data value. Therefore, each pixel can be individually mapped; this is why raster-based datasets are also called continuous data. Previously, this course has focused on vector datasets, which are comprised of points, lines, and polygons. 

To create raster-based datasets, sample data is taken at specific geographic points [stations] and the areas in between are filled in [interpolated] using various algorithmic methodologies. Essentially, this provides a mathematical estimate for the areas that lie between sampling stations, because it would be impossible to collect data [precipitation amounts in the state of Washington for this exercise] at every geographical pointFor the Module 6 lab, we were given a data set that was created by the PRISM [Parameter-elevation Relationships on Independent Slope Model] Group, located out of Oregon State University; this data set included annual precipitation amounts for the state of Washington from 1981 through 2010. For background context, PRISM, unlike conventional interpolation methods, incorporates a regression function into each data cell that considers physiological characteristics of that geographic location, such as elevation, coastal proximity, and other factors. This provided a more accurate interpolated precipitation map than what was previously drawn by hand, and the PRISM model has been continuously evolving, and improving, since its initial introduction in 1991. 

Using ArcGIS Pro, the first half of this exercise was to map the dataset using continuous tones. This means that instead of creating classes of data ranges, there is a continuous color "ramp" between the highest data value and the lowest; each pixel's data value can fall anywhere on the spectrum between the highest and lowest data values. While this method is more accurate on a pixelated basis, it will only give a generalized estimate when viewed with the naked eye.

The second half of this exercise was to map the dataset using hypsometric tinting [using ArcGIS Pro]. This method employs the use of data classes where each pixel falls within the range of a single data class. Each data class is attributed to a different color, allowing the user to easily identify which range each pixel belongs. We also used a geoprocessing tool that created contour lines which outlined each of these data classes, further defining that boundaries of each area. While this method is not as accurate as using continuous tones, it does allow a quicker analysis by giving the user a generalized range in which the data for each area lies. 

This lab exercise was very straightforward, and no issues were encountered during the cartographic process. It was a great opportunity to use various tools included in the ArcGIS Pro software platform, including Hillshade Function, INT Tool, and the Contour List Tool. I was very pleased with the created deliverable, and believe that it effectively portrays the information in an aesthetically pleasing manner. 


Source:

     Daly, C., & Bryant, K. (2013). The PRISM Climate and Weather System—an Introduction. Corvallis, OR: PRISM Climate Group, 2.

Thursday, April 18, 2024

GIS 5007 Module 5 - Choropleth and Proportional/Graduated Symbol Mapping

This week's module focused on choropleth and proportional/graduated symbol mapping; choropleth mapping is a mapping technique that uses a graduated shading scheme across predefined enumeration units [typically political boundaries, such as counties, states, or countries in this case]. Proportional/Graduated symbol mapping is a mapping technique that places dots at geographic locations where occurrences take place, and uses progressively bigger symbols to portray differences between classes; also, these dots can be placed at either true or conceptual points during the mapping process. For this exercise, we used the choropleth method to map the population density of many major European countries and we used the proportional/graduated symbol method to map how much wine is consumed in each of these same countries. 

Overall, this assignment was a great introduction to these two mapping schemes, and many challenges were met throughout the entirety of this assignment. ArcGIS has been the software platform used for each module's assignment, and has never presented any issues while running over a virtual desktop environment - until Module 5. For extra credit, we were allowed to use pictorial symbols for our "dots" on this map, and I found a fun little clip art file at Freepik. Once this little .SVG file was introduced to the ArcGIS project file, every action taken to create this map was slowed by an incredible amount.

The process in classifying the data was relatively simple; I chose the natural breaks method, but needed to include a fifth class so detail was not lost having only four classes. However, to create the inset maps, data had to be excluded from the main map. This regenerated new class values, so I ended up selecting the manual intervals option where I could input the original class values. 

Finally, converting all labels to annotations and converting the wine consumption feature class to a point [it was originally a polygonal feature class] also proved to be quite burdensome while working over a virtual desktop. Slowly, I was able to get each label and grape cluster positioned in a manner that was easy to read and understand.

I am very happy with the quality of this map, and I feel that this exercise proved to quite helpful in grasping an understanding of these mapping methods.

Thursday, April 11, 2024

GIS 5007 Module 4 - Data Classification


This week's assignment was based on Data Classification Systems, and how each system can be used to convey information differently. We were tasked with creating two maps of the 2010 Census Tracts [United States Census Bureau] of Miami-Dade County, Florida and graphically portraying 1.) the percentage of Senior Citizens residing in each tract, and 2.) the number of Senior Citizens per square mile in each tract. For each of these maps, we were to display the data utilizing four different data classification methods and displaying the results using graduating color schemes. After final data analysis, we had to decide which map portrayed the information in the most accurate manner. As shown above, I decided that the number of Senior Citizens per square mile was the most accurate depiction, and I will discuss the reasons why toward the end of this post.

The four classification systems that we focused on were Equal Interval, Natural Breaks, Quantile, and Standard Deviation. Below is a brief synopsis of each:

Equal Interval: this data classification system takes the range of values for each feature [or observation] and creates classes that have equal value ranges. For example, if the values ranged from 0 to 100, there would be four classes with a range of 25 or five classes with a range of 20.

Natural Breaks: this data classification system takes the range of values for the entire data set, and creates class ranges that are based on any gaps that occur within the data set. For example, if there is a cluster of observations that range in value from 0 to 10 and the next observation has a value of 14, the computer would create a class that maxes out at 10. The next class would end at the next break that occurs [naturally] in data values, and this would continue until the desired number of classes are created. 

Quantile: this data classification system takes the total number of features [or observations], and creates classes that have approximately equal number of observations. For example, Miami-Dade County includes 521 census tracts [as of 2010]; this equates to four classes of 104 tracts and one class with 105 census tracts. The class ranges are dictated by the values of the 104th, 208th, 312th, and 416th data values.

Standard Deviation: this data classification system takes the entire data set, calculates the statistical mean, and creates classes that are higher and classes that are lower than the mean. There are multiple classes on each side of the mean, and graduated colors are used to visually express how far the values deviate from the calculated average.

After analyzing the data, it was apparent that Standard Deviation and Natural Breaks depicted the values more accurately than the Equal Interval and Quantile methods. The biggest issue with Equal Interval was that the data set was highly skewed to the lower end, so many values were clustered into a single class that should have been divided further. The result was a major loss in detail across the map. Similarly, the Quantile map was also misleading because of the data skew. The major issue with this classification method was that many features with very similar values were placed into different classes, and the fifth class had a range that was far greater than the preceding classes. This creates ambiguity within the map and is potentially misleading to the map viewer; this is the reason that Quantile Data Classification is appropriate for data sets that follow a linear fashion, as opposed to a data set that is highly skewed such as this one.

Finally, after careful consideration between the two maps, it was evident that the number of Senior Citizens per square mile provided a more accurate depiction of census tracts with higher densities of people over the age of 65. To illustrate, a census tract with 95 people over the age of 65 with a total population of 120 yields 79% of Senior Citizens. Conversely, a census tract with 2372 people over the age of 65 with a total population of 9593 yields 24.7% of Senior Citizens. Therefore, it is imperative that the data be normalized against a standard unit of measure to avoid any obscurities. This is why the number of Senior Citizens per square mile depicts higher density levels of Senior Citizens more accurately than mapping percentages of Senior Citizens alone. 

Overall, this lab assignment was an excellent opportunity to dive into different data classification methods and closely analyze how each differs from the others; this assignment allowed us to start making connections on which data classification method is appropriate to use for which kind of scenario. For comparison, I have attached the map containing percentages of Senior Citizens residing in each census tract below.


Thursday, April 4, 2024

GIS 5007 Module 3 - Cartographic Design


 Module 3 of Cartography was based on cartographic design; essentially, this consisted of applying the information we have learned in Modules 1 and 2, and applying additional cartographic theories to create an effective map that is aesthetically pleasing and visually harmonious. The principles discussed in this module were as follows: creating a visual hierarchy, contrast, a proper figure-ground relationship, and balance. To demonstrate our understanding of these concepts, we were tasked with creating a map of Washington D.C. that illustrates the location of schools throughout Ward 7, specifically. 

To create this map, shapefiles were provided that included many elements of Washington D.C., including interstates, highways, roads, neighborhoods, parks, rivers, Ward 7, and school locations located in Washington D.C. After these were imported into ArcGIS, discretion could be used to decide which elements were necessary, which were not, and what information was needed to effectively convey the required information. 

The first decision that was made was to incorporate all map elements on a landscape page  orientation. I created a layout in portrait and one in landscape to see which map could utilize a larger scale, but there was no significant difference. I chose landscape because I thought it would create an opportunity for a more interesting final product. After this decision had been made, I began playing with color schemes that would begin to establish a visual hierarchy on the page.  For this project, I decided to color the base map with various shades of grey and use a few additional hues to accentuate certain landmarks that exist within the city. For these landmarks, I chose hues of red, blue, and green to identify major highways [roads were left white in color], rivers, and parks that lie within Ward 7 of Washington D.C. While these colors are conventional cartographic standards for these particular types of landmarks, I deliberately chose to incorporate unsaturated values of these colors to avoid confusion within the visual hierarchy I was trying to establish. Next, I chose a dark, burnt red color for the school icons that exist throughout the map. This dark red created a strong presence on the map, telling the reader that school locations were the story being told. Finally, a black san serif font type was used in the title, and the burnt red was used on other map elements to also add to the visual hierarchy on the page.

The color choices incorporated were also chosen to create an appropriate amount of contrast on the map. The greys and other hues used in the base map create a vast amount of contrast with the white space that lies on the outside edges of the layout, while the burnt red color of the icons and legend creates a high contrast with the base map they lie on top of.  Without, this high volume of contrast, the map reader's eyes would not be drawn directly to the school icons and the title block subsequently; this would create visual confusion while looking at the map and the essential information would be lost in translation. This is the reason that contrast plays such an integral role in the cartographic process. 

According to the text we were given, a proper figure-ground relationship is established within areal features by filling the focal area with lighter tones, and using darker tones on the surrounding areas. Conversely, to employ a figure-ground relationship with points that lie on the map, darker colors give the thematic icons a heavier presence, increasing their visual weight on the page. This is also illustrated by the color scheme used throughout the map. The focal point of the map [Ward 7] was filled with a lighter grey [10%], while the remaining Washington D.C. area was filled with a darker shade of grey [20%]. Additionally, the school icons were given the burnt red shade to establish prominence on the map. Not only do these color schemes aid in establishing a visual hierarchy, but they also form a proper figure-ground relationship that accentuates the importance of the schools within Ward 7 to the map viewer. 

Finally, I decided to utilize the angles of the Washington D.C. municipal boundary to create harmony between the map and the outlying map elements. To accomplish this, I arranged to title, subtitle, scale bar, legend, and North arrow in an angular fashion that loosely follows the northeasterly boundary of Washington D.C. For the inset map, I chose to create a polygonal shape that replicated the angle of the southeasterly border. To tie it all in, I chose to align the top edge of the inset map with the major arterial road that dissects Ward 7. With the alignment of all these lines and angles, a visual harmony was created on a page that consists of a very asymmetrical layout. 

This exercise was a great opportunity to expand our knowledge of this complex software platform, and I learned many things while creating this map. The greatest challenge I encountered was finding an efficient way to create the interstate labels. While the shield icons are included in the ArcGIS icon gallery, there was no field in the attribute table for the interstate feature class that included only the interstate number; all fields included the word "interstate". To properly label the shield icons with only the number, I created a new field in the attribute table, executed the 'calculate field' function, and found an Arcade function that extracted the text following a delimiter [a space in this particular case]. This created a field that included ONLY the interstate number, which I used to create labels for these roadways. The other customization that I had to make was to add the word "neighborhood" after the neighborhoods that were being labeled. Without the word 'neighborhood', the labels seemed arbitrary and confusing to anyone who is not from the D.C. area. To remedy this, I added a simple VBscript code to the label properties window that added a line break and the desired text; this added code read as follows: VBcrlf & "Neighborhood".

Overall, I am extremely pleased with the final product of Module 3, and I feel confident that my map exemplifies my understanding of the principles outlined in the text. 

GIS 6105 Module 6 - Interpolation

For the final map deliverable, I simply modified the map from Module 5 to create a sense of continuity between the two sequential lab assign...