Monday, May 18, 2020

Python Fundamentals


The focus this week was getting down the basics of Python programming.  That means understanding variables and lists, using methods and functions, if-elif-else statements, for and while loops.

The first task was to make a string of my full name, then put each name into a list using the split function, then use string indexing to isolate just the last name.  Fairly straightforward, but it's a good way to make sure you have the basics down.

The next task was to fix two errors within a basic dice game.  I first tried to run the game to see where the code got hung up.  I then identified the problems (you can't concatenate an int to a string without first changing the type of the int, and a variable capitalization issue) and fixed them so that the code would properly run.

The final task this week was mastering loops.  First, I used a while loop to append 20 integers to an empty list.  When the list was complete the program printed the list.  Then I chose an integer that I wanted to remove from the list and assigned it to a variable.  I used the count method to check for the presence of this variable within the list in an if-else statement.  The statement would print out if the integer was in the list and how many times it was there.  Then I used a while that ran while the count of the chosen integer was greater than zero.  For each pass through the loop it removed one instance of the chosen integer.  Then the adjusted list was printed again.

Showing the results of the various basic processes covered in this lesson.
Flowchart for the luckyList section of the code.




Monday, May 11, 2020

Python Programming for GIS

This week is the start of another class - GIS programming.  Currently, the predominate scripting language for ArcGIS is Python which we will be using for this class.  Learning to program is useful as it helps to automate tasks and make routine functions much faster.

So far, we have been introduced to the concept of pseudocode which is the line-by-line process of thinking about what we want the code to do without writing it in standard Python syntax.  We also ran a Python script in the IDE Spyder which automatically generated a set of folders for out projects in the coming weeks.

The script-generated folders for the class.

Thursday, April 16, 2020

Google Earth and 3D Mapping

The final project for Cartography class was using Google Earth Pro and .kmz files.  The goal of this lab was to familiarize ourselves with presenting 3D depictions of data by creating a multi-city tour of Southern Florida.

We first had to convert our surface water date in ArcPro to a .kmz file so that it could be imported into Google Earth.  This is done with the "Layer to KML" tool.  Next, I launched Google Earth Pro and imported the required .kmz files.  I also placed a legend on the 3D map.

To create the tour itself, I had to locate the points of interest on the map and then create placemark points for each one.  Following that, I used the program's "record tour" feature to make a recording of each location.  This produces a video of each location that shows off the 3D cityscapes.

Google Earth Pro is fairly straightforward to use, though because of its large scale it can be taxing on a lower end computer when the map is zoomed out.  I think this technology could work particularly well for creating virtual tours of places - such as historic neighborhoods - where an audio narrative could accompany the video.

A dot density population map of Southern Florida presented in Google Earth Pro.  Various body of water are also colorized to make it more obvious that the population of Florida is centered near the coasts and away from marshy areas.


Saturday, April 11, 2020

Isarithmic Mapping

The focus of the lab this week was isarithmic mapping.  Isarithmic maps depict continuous phenomenon that occur across an area.  The process of interpolation makes it possible for an algorithm to generate data across an entire area even though there are only set locations gathering data..  This type of map is particular common for climatological data and is used in a number of industries such as agriculture and engineering.  

I created a map of the average annual precipitation rates in Washington state using a 30 year data set ranging from 1981-2010.  The interpolation method used on this data was the Parameter-elevation Relationships on Independent Slopes Model, also known as PRISM.  This method takes data from the weather stations and factors in environmental attributes such as elevation and proximity to the coast in order to generate a complete set of data.

To create this map I first map a hillshade effect layer using data from the annual precipitation raster.  This improves the look of the terrain by creating the appearance of depth.  Areas of high elevation tend to have higher rates of precipitation, so this is a logical feature to incorporate into this map.

The next step was to create hypsometric tints.  A hypsometric tint is a set of classed graduated colors useful for showing the range of a environmental phenomenon.  This used the spatial analyst tool "int" to process the annual precipitation raster.  I then symbolized the colors into proper classes that corresponded with precipitation amounts.

The last part of map creation was to create contours.  Contours are lines that show the discrete changes between value ranges.  This process involved the contours tool on the annual precipitation layer at the same values as were assigned for the hypometric tints.  This makes the divisions between the different classes even more obvious.

An isarithmic map of Washington state showing the average annual precipitation rates over 30 years.  The map utilizes hypometric tinting as well as contour lines to display the data.



Sunday, April 5, 2020

Choropleth Mapping

In this week's lab we continued to learn about making choropleth maps.  This week we also learned how to work with proportional and graduated symbols.  Choropleth maps are maps with shaded sections to convey the intensity of a phenomenon.  These maps must be normalized by area so when comparing different enumeration units you are making a comparison based off of density and not raw data. 

The goal for this week's lab was to create a map that showed the population density throughout Europe in a choropleth format as well as the consumption of wine per captia.  The map was primarily constructed in ArcGIS Pro with some editing in Adobe Illustrator. 

For the population density, I wrote a SQL exclusion to take the countries of Gibraltar, Jersey, Malta, and Monaco out for when classifying the breaks between populations.  This is because those countries are very small, and thus densely populated - making them outliers in the data.  I classed the remaining countries using the natural breaks method into four different classes.  This created a map with a good amount of contrast between countries. 

The wine consumption was shown through a set of graduated symbols with its associated country.  I decided to take on the extra challenge of using custom symbols for this section.  I downloaded a wine glass icon by Thengakola from the Noun Project.  I then edited this icon in illustrator so that it would have a different fill amount for each of the different classes of consumption.  Again I used natural breaks to divide up the data.  I classed the data into five separate groups to create a range of very low consumption to high consumption.

I used ArcGIS Pro's labeling and annotation feature to generate labels for each country.  Some countries are very small and do not consume significant quantities of wine so they have been omitted.  These include: Gibraltar, Guernsey, Isle of Man, Monaco, Jersey, and San Marino. 

In the final map, I created an inset for the countries near the Adriatic Sea.  This is because in the overview map the information in that area was crowded and difficult to read.  The inset allows for clearer interpretation of the data.

A comparison between the population densities of European countries and their per liter wine consumption.  The population density is shown with choropleth mapping and the wine consumption is showed with overlaid graduated wine glass symbols.
Overall, the take away from this map is that wine consumption correlates a lot with the cultural and agricultural practices of a country.  Vatican City beats all other European countries in wine consumption with a whopping 73.78 liters per person (if an average wine bottle is .75 liters, that's about 100 bottles a year!).  This is in large part to the all-Catholic population of the country that takes part in drinking wine for communion.  Appreciation of wine is also cultural as it is popular in France and Italy.  This is in part because they have a long tradition of growing grapes for wine and have the perfect climate and soil conditions for it.  Other countries may not prefer wine as much but that does not mean they are altogether dry.  Countries with low wine consumption tend to have foodways that put more emphasis on other forms of alcohol such as vodka in Russia and Lithuania.

The most challenging part of this map was placing the wine glass symbols and the country labels just so that it was obvious what they were in reference to without occluding anything else.  I now have great appreciation for cartographers who did this work in the pre-digital age.  As a bonus, I think I now have a much better sense of the geography of Europe too.

Saturday, March 28, 2020

Data Classification

The module this week had us exploring different classification methods for data.  The ones we looked at most closely and used for this lab were equal interval, quantile, natural breaks, and standard deviation.  These different classification systems determine what groups data are divided into and thus was color they correspond to on a choropleth map.  Therefore, the classification style chosen for a map can greatly effect the message that it conveys to the audience.  It is important to know what each classification system does and when best to apply it as to not create maps that are misleading.

The equal interval system divides the data into range breaks of equal size based off of number of classes desired.  The range breaks will get however much data there is within the ranges - whether they contain most of the data or none at all.  The ranges are thus almost always going to be unequally filled because of how they are equally spaced out.

The quantile system classifies data into categories with an equal number of data values within each category.  The spacing within the categories will be uneven, but the quantity of content within each class is equal.

The natural break system uses a mathematical algorithm to calculate natural groupings within the data.  The algorithm computes a unique grouping of classifications for each data set. Because how tailored it is this is a preferred choice for many maps.

For standard deviation, classes are created by adding or subtracting the standard deviation from the mean of the dataset. Standard deviation does a good job at creating (statistically) evenly spaced classes.  The way that the data is broken into classes is statistically logical. However, a casual audience may not understand what standard deviation is.

For this project we used census tract data for Miami-Dade county to create maps showing the senior population using different classification methods.  I created eight maps in all.  The first set was the percentage of seniors in each census tract displayed via equal interval, quantile, natural breaks, and standard deviation classifications.  The second used the same grouping of classifications but normalized the population based off of square mileage to find the density of the senior population in each census tract.  The purpose of the lab was to get us to understand the differences between classification systems, how to normalize data, and the overall usage of choropleth maps.  All of this work was performed using ArcGIS Pro.
The percent of senior citizens living within different census tracts of Miami-Dade County.
The population density living within different census tracts of Miami-Dade County.  This data took the count of senior living in each census tract and normalized it based off of the square mileage of each tract.

Most of this maps all use the same graduated bluish-purple color ramp except for the standard deviation maps.  This is because standard deviation maps typically use a diverging color ramp - one color for the classes below the mean and another for those above.

The natural breaks map normalized by square mileage isolated.  This is a strong map for both presentation and for data interpretation. 
I organized the map frames in this order because I believe that they go from conceptually easiest to understand to hardest.  Equal interval is very straight-forward, and quantile is one step of complexity above that.  The actual algorithm behind natural breaks is fairly sophisticated, but it is easy to explain to someone that they are grouped into most alike classes.  Standard deviation is harder to explain to someone without a statistics primer first.  If your audience isn't mathematically inclined using this methodology requires an extra layer of explanation in a way that the others do not. 

The best classification method for this map is natural breaks.  Since the algorithm finds the best class sections within the data it creates a map with good contrast while taking into account possible outliers.  The equal interval maps for both percent and density make it look like there are hardly any seniors at all. While the standard deviation classification is mathematically sound, it is difficult to explain to an audience who is not mathematically oriented and may not be interested in a lengthy explanation.  Quantile also produces a pretty solid looking map, but I like how natural breaks takes into account the grouping of the data. Where people live is influenced by a lot of factors, such as cost of living and access to health care so to divide the data up arbitrarily in quantiles has the potential to be problematic.  It makes more sense to use natural breaks which is able to take into account natural clusters of data.

Additionally, using the natural breaks map that is normalized by square mileage makes the most sense. Normalized data is a more useful depiction than the percentage maps.  If a county official was using a map to determine funding for geriatric-specific medical care, it makes more sense for that official to consult a population density map.  The density map makes comparisons between counties equal, while a percent map the comparisons do not easily transfer between counties.

To further drive this point, imagine if the city official was tasked with allocating funding to ambulances for each tract.  If the official looked at just the percentage, they would assign a large number of ambulances to that rather small dark purple tract that shows up in the Northeast quadrant of the county, but hardly any to the much larger country directly West of it.  When consulting the normalized natural breaks map, these two quadrants are in the same class. Resources should probably be allocated approximately equally between them instead making that decision off of the less balanced population map.



Wednesday, March 25, 2020

Cartographic Design

This week's lesson introduced us to the elements of cartographic design.  This involved learning about the Gestalt principles of things like visual hierarchy, contrast, figure-ground, and balance.  Utilizing these principles serves as a framework for learning how to properly construct a map that is visually beautiful through its layout and how well it conveys its primary goals to the viewer. 

The goal of this map was to display the location of the public K-12 schools of Ward 7 in Washington, D.C. using the cartographic principles of design we had just learned.  The base data was provided for us, but I had to decide how to lay out the content in such a way to make it visually useful.  The bulk of the map work was preformed in ArcGIS Pro with some final touch up work being completed in Adobe Illustrator.

The location of K-12 public schools located within Ward 7 of Washington, D.C.  The primary objective of this lab was to understand and implement the various principles of proper cartographic design.

In creating a map that will show the schools of Ward 7, part of the assignment was to create appropriate symbology for the schools.  I made the school symbols increase in size with the elementary schools having the smallest icons and the high schools having the largest.  The icons are a vibrant purple and yellow which make them contrast against the duller neutral earth tones of the map.  The assignment did not explicitly request the the names of the schools be listed, but without that information the utility of the map is limited.  So I took the symbology another step and coded the shade of yellow to the school type.  This makes it so looking at the list of schools it is easy to pick out the school's designation and unite it to its symbol.

Another thing I learned in this lab was the use of annotations in ArcGIS.  I used this to create text for the neighborhoods within Ward 7.  The default placement of the text contested with some of the other map elements so I carefully had to change their placement so they appropriately blended in with the rest of the map.  A large part of this lab was dealing with the design principle known as "visual hierarchy" which means placing the most important elements in such a way that they are most visible while deemphasizing the background information.  The names of the neighborhoods provides great contextualizing content - especially considering what school a child goes to often depends on what neighborhood they live in.  However, the neighborhoods are not the most important part of the map so they are displayed in a more washed-out gray text.

The concept of figure ground is the notion of making the most important part of the map distinct against the background.  This put focus on the area of interest.  For this lab, I used the screening technique to make Ward 7 lighter than it surroundings and pop out against the darker background.

The shape of Ward 7 naturally lends itself to creating empty space for the placement of other map elements.  By putting content such as the legend and the scale bar in these places it creates a sense of balance within the map.  I tried not to cluster too much information in one particular place so that no part of the map seemed too heavy but instead complemented the central focus of the map.