Visualizing Spatial Distribution of SARS in Carto

by Cheuk Ying Lee (Damita)
Geovis Project Assignment @RyersonGeo, SA8905, Fall 2019

Project Link:

In 2003, there was a SARS (Severe Acute Respiratory Syndrome) outbreak in Southern China. The first cases were reported in Guangdong, China and quickly spread to other countries via air travel. I experienced all the preventive measures taken and school suspension, yet too young to realize the scale of the outbreak worldwide.

CARTO is used to visualize the spatial distribution of SARS cases by countries and by time. CARTO is a software as a service cloud computing platform that enables analysis and visualization of spatial data. CARTO requires a monthly subscription fee, however, a free account is available for students. With CARTO, a dashboard (incorporating interactive maps, widgets, selective layers) can be created.

The data were obtained from World Health Organization under SARS (available here). Two datasets were used. The first dataset was compiled, containing information in the number of cumulative cases and cumulative deaths of each affected country, listed by dates, from March 17 to July 11, 2003. The second dataset was a summary table of SARS cases by countries, containing total SARS cases by sex, age range, number deaths, number of recovery, percentage of affected healthcare worker etc. The data were organized and entered into a spreadsheet in Microsoft Excel. Data cleaning and data processing were performed using text functions in excel. This is primarily done to removing the superscripts after the country names such that the software can recognize, as well as changing the data types from string to numbers.

Figure 1. Screenshot of the issues in the country names that have to be processed before uploading it to CARTO.

After trials of connecting the database to CARTO, it was found that CARTO only recognized “Hong Kong”, “Macau” and “Taiwan” as country names, therefore unnecessary characters have to be removed. After cleaning the data, the two datasets were then uploaded and connected to CARTO. If the country names can be recognized, the datasets will then automatically contain spatial information. The two datasets now in CARTO appear as follows:

Figure 2. Screenshot of the dataset containing the cumulative number of cases and deaths for each country by date.

Figure 3. Screenshot of the dataset containing the summary of SARS cases for each affected country.

Figure 4. Screenshot of the page to connect datasets to CARTO. A variety of file formats are accepted.

After datasets have been connected to CARTO, layers and widgets can be added. First, layers were added simply by clicking “ADD NEW LAYER” and choosing the datasets. After the layer was successfully added, data were ready to be mapped out. To create a choropleth map of the number of SARS cases, choose the layer and under STYLE, specify the polygon colour to “by value” and select the fields and colour scheme to be displayed.

Figure 5. Screenshot showing the settings of creating a choropleth map.

Countries are recognized as polygons in CARTO. In order to create a graduated symbol map showing number of SARS cases, centroids of each country has to be computed first. This was done by adding a new analysis of “Create Centroids of Geometries”. After that, under STYLE, specify the point size and point colour to “by value” and select the field and colour scheme.

Figure 6. Sets of screenshots showing steps to create centroids of polygons. Click on the layer and under ANALYSIS, add new analysis which brings you to a list of available analysis.

Animation was also created to show SARS-affected countries affected by dates. Under STYLE, “animated” was selected for aggregation. The figure below shows the properties that can be adjusted. Play around with the duration, steps, trails, and resolution, these will affect the appearance and smoothness of the animation.

Figure 7. Screenshot showing the settings for animation.

Figure 8. Screenshot showing all the layers used.

Widgets were added to enrich the content and information, along with the map itself. Widgets are interactive tools for users where displayed information can be controlled and explored by selecting targeted filters of interest. Widgets were added simply by clicking “ADD NEW WIDGETS” and selecting the fields to be presented in the widget. Most of them were chosen to be displayed in category type. For each category type widget, data has to be configured by selecting the field that the widget will be aggregated by, for most of them, they are aggregated by country, showing the information of widget by countries. Lastly, the animation was accompanied by a time series type widget.

Figure 9. Sets of screenshots showing the steps and settings to create new widgets.

Figure 10. A screenshot of some of the widgets I incorporated.


The dashboard includes an interactive map and several widgets where users can play around with the different layers, pop-up information, widgets and time-series animation. Widgets information changed along with a change in the map view. Widgets can be expanded and collapsed depending on the user’s preference.

For the dataset of SARS accumulated cases by dates, some dates were not available, which can affect the smoothness of the animation. In fact, the earliest reported SARS cases happened before March 17 (earliest date of statistics available on WHO). Although the statistics still included information before March 17, the timeline of how SARS was spread before March 17 was not available. In addition, there were some inconsistencies in the data. The data provided at earlier dates contain less information, including only accumulated cases and deaths of each affected country. However, data provided at later dates contain new information, such as new cases since last reported date and number of recovery, which was not used in the project in order to maintain consistency but otherwise could be useful in illustrating the topic and in telling a more comprehensive story.

CARTO only allows a maximum of 8 layers, which is adequate for this project, but this may possibly limit the comprehensiveness if used for other larger projects. The title is not available at the first glance of the dashboard and it is not able to show the whole title if it is too long. This could cause confusion since the topic is not specified clearly. Furthermore, the selective layers and legend cannot be minimized. This obscures part of the map, affecting users perception because it is not using all of its available space effectively. Lastly, the animation is only available for points but not polygons, which would otherwise be able to show the change in SARS cases (by colour) for each country by date (time-series animation of choropleth map) and increase functionality and effectiveness of the animation.