United States Presidential Election Results: 1976-2016 in Tableau

By: Vincent Cuevas

Geovisualization Project Assignment, SA8905, Fall 2020

Project link can be found here.

Introduction

The United States presidential elections occur every four years and much attention is placed on the polarization of US politics based on voting for either of the major political parties, the Democratic Party and the Republican Party. This project aims to use visualization to show the results across many different elections over time to view how the American public is voting for these two parties.

Methodology and Data

Tableau was used for the data visualization due to its ability to integrate multiple data sheets and recognize spatial data to instantly create maps. It is also able to quickly generate different types of visualizations in cartographic maps, bar charts, line graphs, etc.

Data was collected from the University of California – Santa Barbara website the Presidency Project. The repository contains data from elections all the way back up to 1789. This visualization will go back to 1976 and view results up until 2016. Other data sources were considered for this visualization, namely MIT’s Election Lab dataset from 1976-2016. However, this dataset contained results for up to 66 different parties that votes were casted for from 1976 to 2016. Incorporating this level of detail would have shown inconsistent data fields across the different election years. Other political parties are omitted from this project due to the inconsistency of party entrants by year and the fact that Democrats and Republicans take up the vast majority of the national vote. The Presidency Project data was used as it provided simpler views of Democrat-Republican results.

Data Retrieval

The downside to using UCSB’s Presidency Project data is that it is not available as a clean data file!

The data was collected from each individual data page into an Excel sheet. One small piece of data that was collected elsewhere was the national voter turnout data, which was taken from the United States Election Project website.

Voting Margin Choropleth Map

Once the data was formatted, only two sheets needed to be imported into Tableau. The first was the state level results, and the second being the national level results. The relationship between the two is held to together by a join on the state fields.

Tableau has a nice feature in that it instantly converts recognizable data fields into spatial data. In this case, the state field generates latitude and longitude points for each state. Drag the auto-generated Latitude and Longitude fields into Columns and Rows, and then drag state under Marks to get this.

For one of the main sheets, one of the maps will show a choropleth themed map that will show voting margin differences between the Democratic Party and the Republican Party. Polygon shapes are needed, which can be done by going to the drop-down menu in Marks and selecting Map. Next, the sheet will need to identify the difference between states that were Democrat vs. Republican. A variable ‘PartyWin’ was created for this and dragged under marks, and colours were changed to represent each party.

The final step requires creating ranges based on the data. Ranges cannot be created manually and require either some programming logic and/or the use of bins. Bins were created by right-clicking a variable ‘VictoryMargin (%)’. The size of each bin is essentially a pre-determined interval (20 was chosen). VictoryMargin(%) was dragged under Marks in order to get a red/blue separation from the colours from Party Win. The Colors were edited under VictoryMargin to get appropriate light/darker hues for each colour. The specific bins were also appropriately labelled based on 20 point intervals.

The screenshot shows that you can hover over the states and retrieve information on Party Win, the percentage of Democrat and Republican votes that year, as well as the Victory Margin. The top-left corner also has Year in the Pages area, which also for a time-series view for each page that contains Year.

Vote Size Dot Symbol Map

While margin of victory in each state illustrates the degree on if the state voted Democrat or Republican, we know that the total number of Democrat and Republican not equal when comparing voting populations across different states. Florida, for example has 9,420,039 total votes casted and had a 1.2% victory margin for the Republicans in 2016. Contrast that with District of Columbia in the same year, which had 311,268 total votes, but with a 86.8% victory margin for Democrats. For the next map, dot symbols are used to determine the vote size (based on the variable Total State Votes) for each state.

The same longitude and latitude generated map will be used from the choropleth map, only this time the dots and the surrounding Open Street basemap are kept intact. A similar approach is taken from the choropleth map using Party Win to differentiate between Republican and Democrat states. The Total State Votes variable is dragged into the size area under Marks to create different dots sizes based on the numbers here. Bins were created once again – this time with an interval break of 2.5 million votes per state. Ideally, there would be customized breaks as many states fall into the lower end of total votes such as District of Columbia. Once the labelled bins are edited, additional information for State, Total Democrat Votes and Total Democrat Votes were entered to view in the Tooltip.

Screenshot of Dot Symbol map based on Number of State Votes in Tableau Worksheet view

Electoral College Seats Bar

American politics has the phrase of “270 To Win“, based on needing 270 electoral seats as of 2020 to win enough seats for the presidency. As recently as 2016, the Democratic candidate Hillary Clinton won the popular vote over the Republican candidate Donald Trump. However, Trump won the majority of electoral seats and presidency based on winning votes in states with a greater total number of seats.

A bar showing the number of electoral seats won can highlight the difference between popular vote, and that greater margin of victory in a state matters less than having a greater number of state seats won. To create this bar the same setup is used having Party Win and State underneath the marks. This time, a SUM value of the number of seats is dragged to the Columns. The drop down list is then changed into a bar.

Dashboard and Nationwide Data Points

Since this data will go into a dashboard, there is a need to think how these visualizations compliment each other. The maps themselves provide data while looking at a view of individual states. The dynamic bar shows the results of each state, though is better at informing the viewer the number of seats of won by each party, and the degree to how many more seats were won. The dynamic bar needs some context though, specifically the number of total seats won nationwide. This logically took the visualization for placing the maps at the middle/bottom, while moving the electoral college bar to the top, while also providing some key indicators for the overall election results.

The key data points included were the party names, party candidates, percentage of popular vote, total number of party votes, total number of electoral seats, as well as an indicator of if either the Democratic or Republican Party won. Secondary stats for the Other Party Vote (%), Total Number of Votes Casted, as well as Voter Turnout(%). Individual worksheets were created of each singular stat and were imported into the dashboard. Space was also used to include Alaska and Hawaii. While the main maps are dynamic in Tableau and allow for panning, having the initial view of these states limits the need to for the user to find those states. All of the imported data had ‘Year’ dragged into the pages area of the worksheet, allowing for a time-series view of all of the data points.

You can see what the time series from 1976 to 2016 looks like in a gif animation via this Google Drive link.

Insights

When looking at the results starting from 1976, an interesting point is that many Southern states were Democratic (with a big part due to the Democratic candidate Jimmy Carter being governor of Georgia) that are now Republican in 2016. 1980 to 1984 was the Ronald Reagan era, where the Californian governor was immensely popular throughout the country. Bill Clinton’s reign from in 1992 and 1996 followed in Carter’s footsteps with the Arkansas governor able to win seats in typically Republican states. Starting with the George W. Bush presidency win in 2000, current voting trends manage to stay very similar with Republican states being in the Midwest and Southern regions, while Democrats take up the votes in the Northeast and Pacific Coast. Many states around the Great Lakes such as Wisconsin, Michigan and Pennsylvania have traditionally been known as “swing states” in many elections with Donald Trump winning many of those states in 2016. When it comes to number of votes by state, two states with larger populations (California, New York) have typically been Democratic in recent years leading to a large amount of total votes for Democrats. However, the importance of total votes is minimized compared to the number of electoral seats gained.

Future Considerations and Limitations

With the Democrats taking back many of those swing states in the most recent election, inputting the 2020 election data would highlight where Democrats were successful in 2020 vs. in 2016. Another consideration would be to add the results since 1854, when the Republican Party was first formed as the major opposition to the Democratic Party.

Two data limitations within Tableau are the use of percentages, and the lack of projections. Tableau can show data in percentages, but only as a default if it is part of a Row % or Column % total. The data file was structured in a way where this was not possible, meaning that whole numbers were used with (%) labelled wherever necessary. Tableau also is not able to project in a geographic coordinate system without necessary conversions. For the purposes of this map, the default Web Mercator layout was used. One previous iteration of this map was also done as a cartogram hex map. However, a hex map may be better in a static map as the sizing and zooming is much more forgiving when using the default basemap.

100 Years of Wildfires in California – Tableau Dashboard Time Series

Shanice Rodrigues

GeoVis Project Assignment @RyersonGeo, SA8905, Fall 2020

Natural phenomenon can be challenging to map as they are dynamic through time and space. However, one solution is dynamic visualization itself through time series maps, which offered on Tableau. Through this application, an interactive dashboard can be created which can relay your data in various ways, including time series maps, graphs, text and graphics. If you are interested in creating a dashboard in Tableau with interactive time series and visuals, keep reading.

In this example, we will be creating a timeseries dashboard for the distribution of California’s wildfires over time. The overall dashboard can be viewed on Tableau Public HERE.

First, let’s go over the history of these wildfires which will present an interesting context for what we observe from these fires over time.

History of Wildfires

There is a rich, complicated history between civilization and wildfires. While indigenous communities found fires to be productive in producing soils rich in fertile ash ideal for crops, colonizers dismissed all fires as destructive phenomenon that needed to be extinguished. Especially with the massive fires in the early 1900s causing many fatalities, such as that in the Rocky Mountains that killed 85 people. The United States Forest Service (USFS) decided in implementing a severe fire suppression policy, requiring fires of 10 acres or less to be put out beginning in 1926, and then all fires to be put out by 10 A.M. the next day in 1935. It is expected that from the immediate extinction of fires in the early to mid-1900s, natural fire fuels such as forest debris continued to build up. This is likely the cause of massive fires that appeared in the late 1900s and persist to the current age which continue to be both difficult and expensive to manage. This pattern is obvious, as shown on the bar graph below for the number of fires and acres burned over the years (1919-2019).

Dashboard Creation

Data Importation

Many types of spatial files can be imported into Tableau such as shapefiles and KML files to create point, line or polygon maps. For our purposes, we will be extracting wildfire perimeter data from the Fire and Resource Assessment Program (FRAP) as linked here or on ArcGIS here.  This data displays fire perimeters dating back to 1878 up till the last calendar year, 2019 in California. Informative attribute data such as fire alarm dates, fire extinction dates, causes of fire and acre size of fires are included. While there is a file on prescribed burns, we will only be looking at the wildfire history file. The data imported into Tableau as a ‘Spatial file” where the perimeter polygons are automatically labelled as a geometry column by Tableau.

Timeseries

The data table is shown on the “Data Source” tab, where the table can be sorted by fields, edited or even joined to other data tables. The “Sheet” tabs are used to produce the maps or graphs individually that can all be added in the “Dashboard” table. First, we will create the wildfire time series for California. Conveniently, Tableau categorizes table columns by their data types, such as date, geometry, string text or integers. We can add column “Year” to the “Pages” card from which Tableau will use as the temporal reference for the time series.

The following timeseries toolbar will appear, where wildfire polygons will appear on the map depending on the year they occurred and is defined by the following scroll bar. The map can be shown as a looped animation with different speeds.

Additionally, the “Geometry” field can be added to the “Marks” card which are the wildfire perimeter polygons. Tableau has also generated “Longitude” and “Latitude” that are the total spatial extent of the wildfire geometries and can be added to the “Columns” and “Rows” tab.

In the upper-right “Show Me” table, the map icon can be selected to generate the base map.

Proportionally Sized Point Features

Multiple features can be added to this map to improve the visualization. First, the polygon areas appear to be very small and hard to see on the map above therefore it may be more effective to display them as point locations. In the “Marks” card, use the dropdown and select the ‘Shape” tab.

From the shape tab, there are multiple symbols to select from, or symbols can be uploaded from your computer into Tableau. Here, we chose a glowing point symbol to represent wildfire locations.

Additionally, to add more information to the points, such as proportional symbol sizes according to area burned (GIS ACRES field) by each fire. A new calculated field will have to be created for the point size magnitudes as shown:

The field is named “Area Burned (acres)” and is brought to the power of 10 so that the differences in magnitude between the wildfire points are noticeable and large enough on the map to be spotted, even at the lowest magnitude.

Tool Tip

Another informative feature to add to the points is the “Tool Tip,” or the attribute box about the feature that a reader has scrolled over. Often, attribute fields are already available in the data table to use in the tool tip such as fire names or the year of the fire. However, some fields need to be calculated such as the length of each wildfire. This can be calculated from the analysis tab as shown:

For the new field named “Fire Life Length (Days)” the following script was used:

Essentially this script finds the difference between the alarm date (when the fire started) and the contained date (when the fire ended) in unit “days.”  

For instance, here are some important attributes about each wildfire point that was added to the tool tip.

As shown, limitless options of formatting such as font, text size, and hovering options can be applied to the tool tip.

Graphics and Visualizations

The next aspects of the dashboard to incorporate would be the graphs to better inform the reader on the statistics of wildfire history. For the first graph, it will not only show the number of fires annually, but the acres burned as this will show the sizes of the fires.

Similarly to the map, the appropriate data fields need to be added to the columns and rows to generate a graph. Here the alarm date (start of the fire) is added to the x-axis, whereas the number of fires and Gis Acres (acres burned) was added to the y-axis and are filtered by “year.”

The field for the number of fires was a new field calculated with the following script:

Essentially, every row with a unique fire name is counted for every year under the “Alarm_Date” field to count the number of fires per year.

Another graph to be added to this dashboard is to inform the reader about the causes of fires and if they vary temporally. Tableau offers many novel ways of displaying mundane data into interesting visualizations that are both informative and appealing. Below is an example of a clustering graph, showing number of fires by cause against months over the entire timeseries. A colour gradient was added to provide more emphasis on causes that result in the most fires, displaying a bright yellow against less popular causes displayed with crimson red.

Similarly to the map, the “(Alarm_Date)” was added to the “Filters” card, however since we want to look at the average of causes per month rather than year, we can use the dropdown to change the date of interest to “MONTH.”

We also want to add the “Number of Fires” field to the “Marks” card to quantify how many fires are attributed to each cause. As shown, the same field can be added twice, such as one to edit its size attribute and one to edit its colour gradient attribute.

Putting it All Together

Finally, in the “Dashboard” tab, all these pages below of the timeseries map and graphs can be dragged and dropped into the viewer. The left toolbar can be used to import sheets into, change the extent size of the dashboard, as well as add/edit graphics and text.

Hopefully you’ve learned some of the basics of map and statistical visualizations that can be done in Tableau using this tutorial. If you’re interested in the history, recommendations and limits of this visualization, it is continued below.

Data Limitations and Recommendations

Firstly, with the wildfire data itself there are shortcomings, particularly that fires may have not been well documented prior to the mid-1900s due to the lack of observational technology. Additionally, only large fires were detected by surveyors whereas smaller fires were left unreported. With today’s technology in satellite imagery and LiDAR, fires of all sizes can be detected therefore it may appear that more fires of all sizes happen frequently in the modern age than prior. Besides the data, there are limitations with Tableau itself. First, the spatial data are all transformed to the spatial reference system WGS84 (EPSG:4326) when imported into Tableau and there can be inaccuracies of the spatial data through the system conversion. Therefore, it would be helpful for Tableau to utilize other reference systems and provide the user the choice to convert systems or not. Another limitation is with the proportional symbols for wildfires. The proportional symbol field had to be calculated and used had to be put to the “power of 10” to show up on the map, with no legend of the size range produced. It would be easier for Tableau to have a ‘Proportional Symbol” added onto the “Size” tab as this is a basic parameter required for many maps and would communicate the data easier to the reader. Hopefully Tableau can resolve these technical limitations to making mapping a more exclusive format that will work in visualizing many dataset types.

With gaps in wildfire history data for California, many recommendations can be made. While this visualization looked at the general number of fires per month by cause, it would be interesting to go in depth with climate or weather data, such as if there are an increasing number of thunderstorms or warmer summers that are sparking more fires in the 200s than the 1900s. Additionally, visualizing wildfire distributions with urban sprawl, such as if fires in range of urban centers or are more commonly in the range of people so are ranked as more serious hazards than those in the wilderness. Especially since the majority of wildfires are caused by people, it would be important to point out major camping groups and residential areas and their potential association with wildfires around them. Also, recalling the time since areas were last burned, as this can quantify the time regrowth has occurred for vegetation as well as the build-up of natural fuels which can then predict the size of future wildfires that can occur here if sparked. This is important for residential areas near these areas of high natural-fuel buildup and even insurance companies to locate large fire-prone areas. Overall, improving a visualization such as this requires the building of context surrounding it, such as filling in gaps of wildfire history through reviewing historical literature and surveying, as well as deriving data of wildfire risk using environmental and anthropogenic data.

Monitoring Water Level Changes Using High Spatial and High Temporal Resolution Satellite Imagery

Author: Menglu Wang

Geovis Project Assignment @RyersonGeo, SA8905, Fall 2019

Introduction

The disappearing of the once world’s fourth largest lake, Aral Sea, was a shocking tragedy to the world, not only just the shrinkage of lake volume from 1,093.0 km3 in 1960 to 98.1 km3 in 2010 ( Gaybullaev et al., 2012), but also, the rate of shrinkage. Impacts on environment, local climate, citizen’s health, and agriculture are irreversible. This human made disaster could have been prevented in some degree if close monitoring of the lake was made and people are more educated about the importance of ecosystem. One efficient approach to monitor lake water level changes is the utilizing of satellite imagery .The spreading of free high spatial and high temporal resolution satellite imagery provides excellent opportunity to study water level changes through time. In this study, spatial resolution in 3  and 5 meters and temporal resolution as high as 3 days per visit PlanetScope Scene Satellite Imagery are obtained from Planet website. Iso-Cluster Unsupervised Classification in ArcGIS Desktop and Animation Timeline in ArcGIS Pro are used. Study area is set to Claireville Reservoir and 10 dates of imagery starting from April to late June are used to study water level changes.

Data Acquisition

To download the satellite imagery, a statement of research interest needed to be submitted to Planet Sales personal on their website (https://www.planet.com/). After getting access, go on typing in the study area and select a drawing tool to determine an area of interest. All available imagery will load up after setting a time range, cloud cover percentage, area coverage, and imagery source. To download a imagery, go select a imagery and click “ORDER ITEM” and items will be ready to download on the “Orders” tab when you click on your account profile. When downloading a item, noticing that there is a option to select between “Analytic”, “Visual”, and “Basic”. Always select “Analytic” if analysis will be made on the data. “Analytic” indicating geometric and radiometric calibration are already been made to imagery.

Methodology

ArcGIS desktop is used to implement classification and data conversion. Following after, ArcGIS Pro is used to create a animated time slide. Steps are list below:

  1. After creating a file geodatabase and opening a map, drag imagery labeled letter ending with “SR” (surface reflectance) into the map .
  2. Find or search “Mosaic To New Raster” and use it to merge multiple raster into one to get a full study area (if needed).
  3. Create a new polygon feature class and use it to cut the imagery into much smaller dataset by using “Clip”. This will speed up processing of the software.
  4. Grab “Image Classification” tool from Customize tab on top after selecting “Toolbars”.
  5. On “Image Classification” toolbar, select desired raster layer and click on “Classification”. Choose Iso Cluster Unsupervised classification. Please see Figure 1. for classified result.
  6.  Identify classes that belong to water body. Search and use “Reclassify” tool to set a new value (for example: 1) for classes belong to water body, leave new value fields empty for all the rest of classes. Check “ Change missing values to NoData” and run the tool. You will get a new raster layer contain only 1 class: water body as result (Figure 2. and Figure 3.).
  7. Use “Raster to Polygon” tool to convert resulted raster layer to polygons and clean up misclassified data by utilizing editor tool bar. After select “Start editing” from Editor drop down menu, select and delete unwanted polygons (noises).
  8. Use resulted polygons to cut imagery in order to get a imagery contain water bodies only.
  9. Do the above process for all the dates.
  10. Open ArcGIS Pro and connect to the geodatabase that has been using in ArcGIS Desktop.
  11. Search and use “Create Mosaic Dataset” tool to combine all water body raster into one dataset. Notes: Select “Build Raster Pyramids” and “Calculate Statistics” in Advanced Options.
  12. After creating a mosaic dataset, find “Footprint” under the created layer and right click to open attribute table.
  13. Add a new field, set data type as “text” and type in dates for these water body entries. Save edited table.
  14. Right click on the layer and go to properties. Under time tab, select “each feature has a single time field” for “Layer Time”, select the time field that just has been created for “Time Field”, and specify the time format same as the time field format.
  15. A new tab named “Time” will show up on first line of tabs in the software interface.
  16. Click on the “Time” tab and specify “Span”. In my case, the highest temporal resolution for my dataset is 3 days, so I used 3 days as my “Span”.
  17. Click the Run symbol in the “Play Back” section of tabs and one should see animated maps.
  18. If editing each frame is needed, go to “Animation” tab on the top and select “Import” from tabs choose “Time Slider Step”. A series will be added to the bottom and waiting to be edited.
  19. To export animated maps as videos, go to “Movie” in “Export” section of Animation tabs. Choose desired output format and resolution.  
Figure 1. Classified Satellite Imagery
Figure 2. Reclassify tool example.
Figure 3. Reclassified satellite imagery

Conclusion

A set of high temporal and high spatial resolution imagery can effectively capture the water level changes for Claireville Reservoir. The time range is 10 dates from April to June, and as expected, water level changes as time pass by. This is possibly due to heavy rains and flood event which normally happens during summer time. Please see below for animated map .

Reference

Gaybullaev, B., Chen, S., & Gaybullaev, D. (2012). Changes in water volume of the Aral Sea after 1960. Applied Water Science2(4), 285–291. doi: 10.1007/s13201-012-0048-z

Creating Effective Landsat Timelapses

When asked to describe a satellite time-lapse, it is extremely likely that one would extrapolate some sort of time-series creation that shows gradual change with the use of natural colour images. It is however in this method of displaying satellite imagery, that a great deal of information is lost. To elaborate, individuals viewing such time-series creations cannot interpret quantifiable descriptors that may aid in conveying a message. Take for example the time-lapse provided below.

For what it is, a simple visual attempt at identifying change, the time-lapse above does an effective job at conveying change. Having said this however it does not provide the viewer with quantifiable observations, like the area developed per year, or even the ratio of land to water, as an example. Such statistics would be extremely useful in not only further illustrating a point, but also further encapsulating a viewer in the creation made. With this being said there are methods in which information can be derived from satellite imagery to provide viewers with a greater level of detail.

Within the realm of remote sensing, or the field in which data are collected without having a physical presence, there are a number of methods that allow individuals to interpret quantifiable data from the images one may capture. The most significant method being, a change detection. As a brief summary of what a change detection is, it is a temporal analysis between two, or more, periods of time, where either multi-spectral, or hyper-spectral images, and subsequent band combinations, are used to identify quantifiable areas of change between temporal foci. A change detection is of significant importance as it imparts the viewer with a definitive measure of change, far from the interpreted observation of change found within a regular timelapse. Taking a step back, one could quite easily identify, and even argue that in order to create a more effective timelapse, one could combine aspects of a change detection, creating an enhanced, and ever effective geo-visualization. Such a creation would bridge the gap between the lay, and the academic.

But such a thought begs the question; how could this be accomplished? Better yet, how could a timelapse, comprised of hundreds of composite spectral images, that displays a quantifiable characteristic, be created in an timely, and effective manor?

Put simply, programming is the answer to such questions. 

By creating a number of programs, an effective timelapse can be created that can be an effective evolution, from what was previously used. In an attempt to elaborate such a plan, such an attempt follows three steps:

  1. Create a program, a web-driver, that downloads an entire dataset, in this case all Landsat 4 – 5, imagery for a specific row, and path, in the absence of an API, or database. For an effective geo-visualization to be created, a great deal of data are needed.
  2. Instantiate a program, that opens each file, in this case Landsat image, and pulls three bands to be used to create a composite image that will better show a specific type of geographic change..
  3. Develop a program, that classifies imagery based on a predefined signature class, a file containing information on predetermined training classifications, that will then find, and append, the total area of a classification to a CSV file.

Put simply, the series of programs that will be created will create the intended geo-visualization, as well as do so in an efficient manor.

Attached are two links to a Dropbox folder, both links are direct connections to both programs needed to, download, and compose the images in focus.

Image Downloader:

https://www.dropbox.com/s/63ig83vd30ydk0a/Composite_Composer.py?dl=0

Image Composer:

https://www.dropbox.com/s/63ig83vd30ydk0a/Composite_Composer.py?dl=0

*Note, that in-depth comments have been provided for each stage, within each program. A general idea, as well as flow of each program should be quite easy to interpret.

It should be noted however, in the process of creating such a geo-visualization, a significant error arose. To elaborate, in the process of creating the final program, the GIS software, in this case ArcGIS, through the manipulation of ArcPY, failed on multiple attempts to read a signature file, and create a classification for each image. After much research it was concluded that an internal, however still unresolved issue was the main cause. As such, the final, and most important program could not be created.

The images created, were then edited in Adobe Lightroom, a image manipulation software, to remove any significant errors, and stitched together using Adobe Premiere Pro. Additional peices of information, such as titles, summaries, as well as dates were added within Adobe After Effects. The final geo-visualization can be seen below.

In summary, the Landsat timelapse created is extremely unique, it can safely be argued that there are no other geo-visualization methods like it currently present. In regards to what was attempted to be solved, it however did not accomplish all the tasks set out. From the perspective of the viewer, it is an easier method of data interpretation, however, it still lacks the quantifiable data aspect.

With all of this being said however, it is hoped that in the future, when previously mentioned bugs in software are fixed, another, more successful attempt at this geo-visualization can be made.

Time-series Animation of Power Centre Growth in the Greater Toronto Area for the Last 25 Years

By: Jennifer Nhieu
Geovisualization Class Project @RyersonGeo, SA8905, Fall 2018

Introduction:

In 1996, there were 29 power centres with 239 retail tenants accounting for just under five million square feet of retail space (Webber and Hernandez, 2018). 22 years later, in 2018, there are 125 power centres with 2,847 retail tenants accounting for 30 million more square feet of retail space (Webber and Hernandez, 2018). In addition, power centres expand in an incremental manner, either through the purchase and integration of adjoining parcels or the conversion of existing parking space into new stores (Webber and Hernandez, 2018). This development process often leads to retail centres becoming “major clusters of commercial activity that significantly exceed the original approved square footage total” (Webber and Hernandez, 2018, pg. 3).

Data and Technology:

To visualize this widespread growth of power centres from 1996 to 2017, a time-series animation map was created on Kepler.gl. (beta version) using power centre growth data provided by the Centre for the Study of Commercial Activity (CSCA) at Ryerson University, who undertakes an annual field survey-based inventory of retail activity in the Greater Toronto Area. Kepler.gl was created by Uber’s visualization team and released to the public on the summer of 2018. It is an “open source, high-performance web-based application for visual exploration of large-scale geolocation data sets. Kepler.gl can render millions of points representing thousands of trips and perform spatial aggregations on the fly” and is partnered with Mapbox, a “location data platform for mobile and web applications that provides open-source location features”. (Uber Technologies Inc., 2018 and Mapbox, 2018).

Methodology:

The data provided by the CSCA includes information on the shopping centre’s name, a unique identification code for each power center, the longitude and latitude coordinates for each power centre, its square footage information from the year it was built to 2017 and etc. The data had to be restructured on Microsoft Excel to include a pseudo date and time column, which would include the years 1992 to 2017, as well as 1-hour time intervals to allow Kelper.gl to create an animation based on date and time. The table below is an example of the data structure required to create a time animation on Kepler.gl.

Table 1: Data structure example*

Table 1: Data structure example*
*The data in this table has been modified due to confidentiality reasons.

Below is the time series animation set up for visualizing power centre growth on Kepler.gl. This process can also be replicated to produce another time-series animations:

  1. Visit https://kepler.gl/#/
  2. Click Get Started.
  3. Drag and drop .csv file onto application.
  4. Hold and drag to navigate to the Toronto GTA.
  5. On the contents bar, click + Add Layer on the Layers
  6. Under Basic Layer Type, click Select A Type, then select Point.
  7. Under Columns, Lat* = COORDY and Lng* = COORDX.
  8. Under Color, click Color Based On, then select SQ FT.
  9. Under Color, click the color scheme bar, select a preferred light to dark colour scheme.
  10. Under Color, Color Scale, select quantize.
  11. Under Color, Opacity, set to 4.
  12. Under Radius, Radius Based on, Select a field, select
  13. Under Radius, Radius Range, set the range from 1 to 60.
  14. On the contents bar, click + Add Layer on the Filters
  15. Click Select a field, then select
  16. In the slider, drag the rightmost square notch to highlight only 2 bars with the left square notch.
  17. Press the play button the start the animation.

Notes:

  • The speed of the animation can be adjusted.
  • The legend can be shown by clicking the bottom circular button located to the top right corner of the screen.
  • Hover your mouse over a point to see the metadata of the selected power centre.

Figure 1: Power Centre Growth in the Toronto GTA (1992 – 2017)

Limitations:

During the implementation process, it became apparent that Kepler.gl is more focused on graphics and visuals than it does on cartographic standards. The program does not allow the user to manually adjust class ranges on the legend, nor does it accurately display continuous data. The proportional symbols used to represent power centre growth displays flashing or blinking symbols rather than a gradual growth in the symbols. There was an attempt to correct this problem by duplicating the values in the date and time column, and then adding additional pseudo date and time values between each year. However, when tested, the animation exhibited the same flashing and blinking behaviour, therefore it became apparent that is problem exists in the programming of Kepler.gl and not in the data itself. Furthermore, by duplicating these values, the file would exceed the maximum file size on chrome (250mb), and limit performance on Safari, the two web browsers it runs on.

Conclusion:

Regardless of the limitations, as the current Kepler.gl is still in its early beta version, it still has a lot of potential to incorporate user feedback from industry professionals and run additional testing before the final release.

References:

Webber, S. and Hernandez, T. (2018). Retail Development and Planning Policy.   Centre for the Study of Commercial Activity, Ryerson University. Toronto, CA.Uber Technologies Inc. (2018). Kepler.gl. Retrieved from http://kepler.gl/#/
Mapbox. (2018). About Mapbox. Retrieved from https://www.mapbox.com/about/

Invasive Species in Ontario: An Animated-Interactive Map Using CARTO

By Samantha Perry
Geovis Project Assignment @RyersonGeo, SA8905, Fall 2018

My goal was to create an animated time-series map using CARTO to visualize the spread of invasive species across Ontario. In Ontario there are dozens of invasive species posing a threat to the health of our lakes, rivers, and forests. These intruding species can spread quickly due to the absence of natural predators, often damaging native species and ecosystems, and resulting in negative effects on the economy and human health. Mapping the spread of these invasive species is beneficial for showing the extent of the affected areas which can potentially be used for research and remediation purposes, as well as awareness for the ongoing issue. For this project, five of the most problematic or wide-spread invasive species were included in an animated-interactive map to show their spatial and temporal distribution.

The final animated-interactive map can be found at: https://perrys14.carto.com/builder/7785166c-d0cf-41ac-8441-602f224b1ae8/embed

Data

  1. The first dataset used was collected from the Ontario Ministry of Natural Resources and Forestry and contained information on invasive species observed in the province from 1982 to 2012. The data was provided as a shapefile, with polygons representing the affected areas.
  2. The second dataset was downloaded from the Early Detection & Distribution Mapping System (EDDMapS) Ontario website. The dataset included information about invasive species identified between 2010 and 2018. I obtained this dataset to supplement the Ontario Ministry dataset in order to provide a more up-to-date distribution of the species.

Software
CARTO is a location-intelligence based website that offers easy to use mapping and analysis software, allowing you to create visually appealing maps and discover key insights from location data. Using CARTO, I was able to create an animated-interactive map displaying the invasive species data. CARTO’s Time-Series Widget can be used to display large numbers of points over time. This feature requires a map layer containing point geometries with a timestamp (date), which is included in the data collected for the invasive species.

CARTO also offers an interactive feature to their maps, allowing users control some aspects of how they want to view the data. The Time-Series Widget includes animation controls such as play, stop, and pause to view a selected range of time. In addition, a Layer Selector can be added to the map so the user is able to select which layer(s) they wish to view.

Limitations
In order to create the map, I created a free student account with CARTO. Limitations associated with a free student account include a limit on the amount of data that can be stored, as well as a maximum of 8 layers per map. This limits the amount of invasive species that can be mapped.

Additionally, only one Time-Series Widget can be included per map, meaning that I could not include a time-series animation for each species individually, as I originally intended to. Instead, I had to create one time-series animation layer that included all five of the species. Because this layer included thousands of points, the map looks dark and cluttered when zoomed out to the full extent of the province (Figure 1). However, when zoomed in to specific areas of the province, the points do not overlap as much and the overall animation looks cleaner.

Another limitation to consider is that not all the species’ ranges start at the same time. As can be seen in Figure 1 below, the time slider on the map shows that there is a large increase in species observations around 2004. While it is possible that this could simply be due to an increase in observations around that time, it is likely because some of the species’ ranges begin at that time.

Figure 1. Layer showing all five invasive species’ ranges.

Tutorial

Step 1: Downloading and reviewing the data
The Ontario Ministry of Natural Resources and Forestry data was downloaded as a polygon shapefile using Scholars GeoPortal, while the EDDMapS Ontario dataset was downloaded as a CSV file from their website.

Step 2: Selection of species to map
Since the datasets included dozens of different invasive species in the datasets, it was necessary to select a smaller number of species to map. Determining which species to include involved some brief research on the topic, identifying which species are most prevalent and problematic in the province. The five species selected were the Eurasian Water-Milfoil, Purple Loosestrife, Round Goby, Spiny Water Flea, and Zebra Mussel.

Step 3: Preparing the data for upload to CARTO
Since the time-series animation in CARTO is only available for point data, I had to convert the Ontario Ministry polygon data to points. To do this I used ArcMap’s “Feature to Point” tool which created a new point layer from the polygon centroids. I then used the “Add XY Coordinates” tool to get the latitude and longitude of each point. Finally, I used the “Table to Excel” conversion tool to export the layer’s attribute table as an excel file. This provided me with a table with all invasive species point data collected by the Ontario Ministry that could be uploaded to CARTO.

Next, I created a table that included the information for the five selected species from both sources. I selected only the necessary columns to include in the new table, including; Species Name, Observation Date, Year, Latitude, Longitude, and Observation Source. This combined table was then saved as an excel file to be uploaded to CARTO.

Finally, I created 5 additional tables for each of the species separately. These were later used to create map layers that show each species’ individual distribution.

Step 4: Uploading the datasets to CARTO
After creating a free student account with CARTO, I uploaded the six datasets as excel files. Once uploaded, I had to change the “Observation Date” column from a “string” to “date” data type for each dataset. A “date” data type is required for the time-series animation to run.

Step 5: Geocoding datasets
Each dataset added to the map as a layer had to be geocoded. Using the latitude and longitude columns previously added to the Excel file, I geocoded each of the five species’ layers.

Step 6: Create time-series widget to display temporal distribution of all species
After creating a blank map, I added the Excel file that included all the invasive species data as a layer. I then added a Time-Series Widget to allow for the temporal animation. I then selected Observation Date as the column to be displayed, meaning that the point data will be organized by observation date. I chose to organize the buckets, or groupings, for the corresponding time-slider by year.

Since “cumulative” was not an option for the Time-Series layer, I had to use CARTCSS to edit the code for the aggregation style. Changing the style from “linear” to “cumulative” allowed the points to remain on the screen for the duration of the animation, letting the user see the entire species’ range in the province. The updated CSS code can be seen in the screenshots below.

Step 7: Creating five additional layers for each species’ range
Since I could only add one Time-Series Widget per map, and the layer with the animation looks cluttered at some extents, I decided to create five additional layers that show each of the species’ individual observation data and range.

Step 8: Customizing layer styles
After adding all of the layers, a colour scheme was selected where each of the species’ was represented by a different colour to clearly differentiate between them. Colours that are generally associated with the species were selected. For example, the colour purple was selected to represent Purple Loosestrife, which is a purple flowering plant. The “multiply” style option was selected, meaning that areas with more or overlapping occurrences of invasive species are a darker shade of the selected colour.

A layer selector was included in the legend so that users can turn layers on or off. This allows them to clearly see one species’ distribution at a time.

Step 9: Publish map
Once all of the layers were configured correctly, the map was published so it could be seen by the public.

Visualizing Alaska’s Forest Damage in Twenty Years

Author: Anitha Muraleedharan
Geovis Project Assignment@RyersonGeo,
SA 8905, Fall 2018 (Rinner)

Forest Damage in Alaska

Alaska is a dynamic region and has a long history of changeable climate. Alaska has lost a lot of its forests due to insect infestation, fire, flood, landslides, and windthrow. Aerial surveys are conducted to monitor forest health for the State of Alaska and to identify insect and some disease pest trends. This time series map animation will visualize the forest damage in Kenai Peninsula, Tanana Region and Fort Yukon Region of Alaska during the years 1989 to 2010. This blog will cover the entire processes involved in creating this visualization.

Data

The spatial data of the forest damage survey conducted during the period from 1989 to 2010 by the Alaska Department of Natural Resources are readily available for download from AK State Geo-Spatial Data Clearinghouse (http://www.asgdc.state.ak.us/?#2952). The shapefiles are available individually for each year from 1989 to 2010 except for years from 2000 to 2007. These data were used for preparing this Time Series map animation.

Preparing Data for Animation in QGIS

QGIS 3.2.3 64bit was used to prepare the data for animated map visualization of Alaska’s forest damage. QGIS is a free and open-source cross-platform desktop geographic information system (GIS) application that supports viewing, editing, visualization and analysis of geospatial data. Since the data were available only as individual files, the first step in preparing the data was to merge this data together into one shapefile. For this task, I used the Merge Vector Layers Tool in QGIS which merged all the individual shapefiles into a single shapefile.

Steps to Merge multiple vector layers into one

  • Step1: Add all the vector layers, intended to be merged, into QGIS
  • Step2: Go to Vector →Data Management Tools → Merge Vector Layers in the menu
  • Step3: Click input layers button and select all the layers needed to be merged
  • Step4: Click Merged Layer button to give a name for the merged output layer
  • Step4: Click Run in Background button to create the merged layer and add it to QGIS

Fig. 1 Merge Vector Layer Tool in QGIS

The next task was to format the timestamp column to fit the QGIS Time Manager plugin tool that will be used to create the animated map visualization. The timestamp column for this data was “SURVEY_YR” which was in four-digit format. The QGIS Time Manager Plugin requires that the timestamp data be in YYYY-MM-DD format. For this, a new field was created with name “Damage_Yr” and type string and used the Field Calculator tool in Processing Toolbox of QGIS.

Fig. 2 Field Calculator Tool in QGIS

In the Field Calculator tool, the expression “tostring(SURVEY_YR) + ‘-01-01’ ” was used to concatenate data in the field “SURVEY_YR” and the “-01-01”  together to make the timestamp in YYYY-MM-DD format and copy the data to the new field “Damage_Yr”.

Fig. 3 Attribute table showing the Damge_Yr in YYYY-MM-DD format after update.

Visualizing the Time Series

The Time Manager plugin was downloaded and installed in QGIS. The forest damage data was then added as a layer in QGIS. The Google Terrain map was added as the base map for this time series animation. The following steps were performed to add the Google Terrain map to QGIS.

  • Step1: Add a new connection to XYZ Tiles in QGIS and give it a name, say “Google Terrain”
  • Step2: Use https://mt1.google.com/vt/lyrs=t&x={x}&y={y}&z={z} as the URL.
  • Step3. Click Ok and then double-click the created layer to add the “Google Terrain” as the layer.

After the data was added, it was time to apply symbology to the polygon data showing the forest damage in QGIS. The layer was styled using the attribute “Damage_Yr” and categorized with sequential symbology. Once the data was styled, the Time Manager plugin needed to be configured to visualize the time series animation.

In the Time Manager Settings window, the Forest damage layer which needs to be animated was added using the “Add layer” button. The Damage_Yr column was chosen for the Start and End time and “Accumulate features” option was selected to show the features accumulated on the map as the year changes during the animation. 500 milliseconds duration was set in the animation options to show each year for that many seconds in the animation before showing the next year. To display each year as a label in the map during the animation, time format was set as “%Y” and the font, font size, and text color were also set.

Fig. 4 Time manager settings window

Fig. 5 Time display options.

The time frame in the Time manager dock was set as years since the forest damage in each year will be animated and displayed. The time frame size for the animation was set as 1 since we have data for each year from 1989 to 2010. The animation can be played by clicking the play button and QGIS will show the forest damage of Alaska in each year from 1989 to 2010 on the map window for 500 milliseconds each.

Fig. 6 Time Manager dock showing settings for the animation in QGIS

Converting the Time Series into Video

The Time Manager allows exporting the animation to a video. However, there is no option to add a legend onto the rendered maps in the animation in QGIS. Therefore, the maps were exported as .PNG image files. The map frames were exported first with the full extent of the map and subsequently, two more times with map zoomed to areas Tanana and Fort Yukon respectively for showing different areas in one animation. The legend along with title and data source labels were then added for each exported map frame using photoshop.

Finally, VirtualDub software was used to convert the .PNG files to video for each series of maps. VirtualDub is a free and open-source video capture and video processing utility for Microsoft Windows written by Avery Lee.  The generated .PNG files were then renamed in ascending order sequence in the format “frameXXX.png” where XXX is the frame number. For example, frame000, frame001 and so on. This is required for VirtualDub to detect the files as a sequence of images and then combine it to a video. The steps followed to create the animated video is as given below.

  • Step1: Open VirtualDub software
  • Step2: Go to File → Open video file option in the menu and navigate to the images folder
  • Step3: Click the first image in the map image series and VirtualDub will automatically add all the other images that are in sequence
  • Step5: Go to Video → Frame rate and set fps as 0.5 to show each frame for 500 milliseconds in the video
  • Step6: Preview the video and save it using File → Save as AVI option in the menu

Fig. 7 Combining the png files in VirtualDub software

Results


Watch the visualization on YouTube