Tutorial: Building Cartograms

The US presidential elections has popularized “cartograms”, a type of map visualization that makes it easier to distinguish areas of higher numeric values (like higher vote counts) by exploding tiny polygons (like coastal areas in the East Coast) to better reflect their perceived values.  For example, take a look at this map of the 2008 presidential elections:

Source: University of Michigan

Red states reflect higher vote counts for John McCain, and blue states reflect higher vote counts for Barack Obama.  Now, when you “cartogram-ize” this map, you get the following result:

These cartograms have been around for quite a while, and are often used in GIS presentations to emphasize the point on how easy it is to create a false visual impression when authoring thematic maps on geographies that have a high contrast between the large and small polygons. This is especially true in US based maps, where coastal areas with high population counts are represented by tiny polygons.

I have often wondered how these cartograms are created, and was told by a graduate student at UCLA that there is now a java tool called ScapeToad that generates cartograms. Moreover, ScapeToad provides a free downloadable wizard-based tool that converts any shapefile into a cartogram!  It is insanely cool.  Here is a tutorial on how to use ScapeToad.

Step 1: Download ScapeToad

Go to http://scapetoad.choros.ch/download.php to download ScapeToad, and run the executable file.

Step 2: Add a layer

Run ScapeGoat, and click on the “Add layer” button, and choose a shapefile to upload. For this example, I chose a USA County shapefile that comes with basic 2000 census data.

Step 3: Create the cartogram

Now click on the “Create cartogram” button, and go through the wizard.  For this example, I chose to create a cartogram based on the attribute for “Hispanic”.

Step 4: Export as Shapefile

Now that you have created a cartogram, you are ready to export it to something usable.  ScapeToad allows you to export to SVG (which you can import into Illustrator), or as a shapefile (which you can import into ArcGIS).  Click on “Export to Shape”, and save the cartogram as a shapefile.  Open ArcGIS and load the shapefile.

When the shapefile is loaded into ArcGIS, it will be drawn in one random color, as this is the default behavior for loading any shapefile in ArcGIS.  Right click on the cartogram layer, and modify the symbology.  I chose to symbolize by:

  • Quantities -> Graduated colors
  • Value: Hispanic
  • Classification: Natural Breaks
  • Classes: 3

Now the cartogram is color coded based on the variable it was cartogramed with: Hispanic.  As a final step, I chose to label the counties that have high values:

US counties with high hispanic population counts (Census 2000)

 

 

UCLA’s Volunteer Day Live Map

UCLA Volunteer Day's live site

Every year for the past 3 years, UCLA has dedicated a day for community service.  On Volunteer Day, the incoming freshman class embarks to various destinations around Los Angeles to clean, paint, beautify, mentor and engage with the community.

As a technologist in charge of the Volunteer Center website, this day provides an incredible opportunity to utilize social media as a forum to capture the many stories and moments that occur throughout the day.  What other chance does one get to have control over a mass exodus of more than 7000 people all over a city?  How can we build a platform that allows us to capture the stories and deliver them in real time?  How might the volunteers on the ground most effectively submit their stories to a centralized public interface?  The answer was to build an awareness around what we dubbed “The Mobile Campaign“.

The result was a map-based interface that “evolved” throughout the day.  Starting out as an empty map at 7:00am, it gradually populated itself as more and more pictures and videos started flowing in, coming directly from the people on the ground, the volunteers themselves!  While you may not be able to experience the day through its “live” interface, feel free to see the hundreds of photos and video’s that came in from almost 30 different locations:

http://volunteer.ucla.edu/live

The technology behind the site was using the following:

  • Google Maps API v3 for the mapping
  • Flickrs API for the photo and video upload and retrieval
  • and lot’s and lot’s of jQuery

TEDx UCLA: Can Twitter Save Lives?

Back in June 18th, 2011, I had the good fortune to be invited to speak at the inaugural TEDx event at UCLA.  I took the opportunity to present about the post disaster situation in Japan and spoke of the potential that social media and locational technologies hold for future crisis management and awareness.

YouTube Preview Image

Japan Earthquake: Emotions at a glance

What was the country “feeling” after the earthquake?  Was it engulfed in sorrow?  Anger?  Fear?  What effect did the hundreds of aftershocks have on the populace?  In an attempt to answer these questions, a social media analysis can provide a window  into the sentiment that was prevalent at each phase of recovery by visualizing each emotion group played out over time.  The charts below stacks each emotion group, one on top of another.  These was generated using the Protovis Javascript API.  Clicking into any of the emotion charts will allow interaction with their values over time:

(view full screen)

In concordance with previous analyses, the most noticeable observations come in the “fear” emotion on April 7th.  Looking at the “Earthquake magnitude” chart, one can see that the second largest aftershock occurs on that day, bringing meaning to the notion that “fear” was a predominant emotional reaction to an already stressed nation at the time.  One can also depict that while the April 7th 7.1 magnitude earthquake was the largest aftershock since the big one on March 11th, that the country was consistently rocked throughout, averaging more than 10 earthquakes a day.  However, as the earthquake chart reveals, the number of quakes had tailored off considerably over time, perhaps causing it to expose even more shock value to the “big” 7.1 quake, at a time when the people were starting to feel a level of normality.

Japan Earthquake: Locating the tweets (Part 4)

“Location” has become an essential component to many social media technologies.  Not only is it important to convey “what happened?”, but also to reveal “where” it happened.  Check-in technologies have become popularized by companies like Foursquare, Gowalla and Yelp, further blurring the lines between the content and the geo-coordinates.  Twitter has traditionally not put an emphasis on the notion of “place”, but they did announce, in late 2009, their own geolocation feature.  Users were now able to enable geolocation in their settings page to reveal the exact location of where they are tweeting from.  While twitter itself does not have an interface for mapping tweet locations, making the data available through their Geotagging API allows third party applications access to this information and map them accordingly.