HOW TO: Create a Geovisualisation Web App with Local Tweets

Categories Articles, Twitter

This is a guest post by Chico Charlesworth. He has created a geographic visualisation with the help of his BBC colleague, Tom Martin. The visualisation mashes up location-aware social data to visually capture people’s experiences and reactions to the royal wedding.

It was built in three days and is showcased as a video and a web application.

A little bit of Twitter goes a long way

The first step was to collect the local tweets during the day of the royal wedding by using Twitter’s Search API and geocodes. Geocodes include the latitude and longitude of a location. The geocode used for the royal wedding was “geocode=51.502652,-0.131493,0.7mi”, which returns tweets located within a 0.7 mile radius from where the royal wedding happened. Over the course of the day, 4000+ local tweets were captured. The visualisation timeline was narrowed down into a 12 hour period, resulting in almost 3000 tweets between the hours of 8am and 8pm.

Mapping local tweets

Once the local tweets were gathered, the next step was to display them on a map. The map is displayed on a web page by using Google’s Maps API, where each local tweet is displayed as a marker. What’s neat is that each marker is visually identifiable as a tweet, a photo or a Foursquare checkin. Best of all, it’s interactive and quite addictive to click on the tweets, photos and checkins as they popup when hovering over their corresponding marker.

Tweet stats

Along with plotting the data on a map, statistics are displayed to add another dimension. The stats are broken down into total local tweets, total checkins, total photos, girls vs boys, top tweeters and top retweets.

Try it yourself

In terms of the technology stack, a Java back-end collected the tweets and made them accessible to a jQuery powered front-end, which in turn updates the map and stats.

The following snippet of code is a simplified version of the real thing.

Future visualisation projects of this kind could be applied to a range of other social occasions including festivals, sporting events and events with strong social buzz.

Chico is a Techie/Startupreneur. You can follow him on Twitter: @ccharlesworth.