January, 2014 Archives

visualizerThe Trip Visualizer has been updated with new data for Capital Bikeshare. Instead of just posting the new quarter, I made all of 2013 a single data set. That’s over two-and-a-half million trips (2,585,010 bikeouts) using 309 stations, summarized into a big origin-destination table.

Montgomery County joined the network in late September, introducing bikesharing to four regions in Maryland: Rockville, Bethesda/Chevy Chase, Silver Spring, and Takoma Park. 73% of bikeouts from Maryland went to other stations in Maryland, with 26% headed to DC. Just under 0.5% (21 trips out of 4,675) went from Maryland to Virginia. The fastest Maryland-to-Virginia ride took 33 minutes, from Friendship Heights Metro to Rosslyn Metro, a trip that takes 27 minutes on Metro. The longest MD/VA trip was 1 hour and 48 minutes, when someone biked from Crystal City Metro to Battery Lane in Silver Spring.

The Trip Visualizer lets you select a single station to see the most-significant trips to/from that station. You can use some hidden features to select clusters of stations, to examine networks. Hitting “M” will select all stations in Maryland. You can see how isolated Rockville is, with its closest station to Bethesda still over five miles away. » Continue Reading…

When I saw Dan Macy’s aerial photo of Washington, DC, I knew I had to turn it into the background for a map. Dan’s plane was flying into National Airport from New York City, and made an unusual entry over the Anacostia River, giving him a spectacular view of East Capitol Street, the Anacostia and Potomac Rivers, and the National Mall.

I’d been looking at the 2013 data from Capital Bikeshare, and made a little app that shows you the total number of bikeouts from each station, the Birds-eye view of CaBi stations. (A bikeout means someone rented a bike from that station.) The program was mostly an excuse to play with JavaScript and SVG graphics, without using a mapping or graphics library.

I had to figure out a not-too-complex way of mapping the latitude and longitude coordinates to the oblique photo. Unlike a map, the meridians (longitudes) aren’t vertical and the parallels (latitudes) aren’t horizontal. The bird’s-eye perspective also meant the meridians and parallels would be skewed. » Continue Reading…

Want to look back at 2013 using Capital Bikeshare data? I’ve put together an interactive tool to examine the 2013 daily ridership statistics for Capital Bikeshare. The data looks at daily “bikeout” totals, that is, how many bikes were checked out each day. You can summarize the data into weeks, months, quarters, and days of the week. The weekly view ignores December 31, in order to avoid having a 53rd week with only a single day in it.

You can compare the difference between bikeouts from subscribers (those with memberships for a month or a year) and casual riders (those with memberships for 1 or 3 days). You can also look at bikeout stats for any of the 306 individuals stations.

The program lets you find the correlation between any two data sets. You can use a second data set to color the bars of the first data set. The correlation is automatically calculated. It ranges from 1, a perfect positive correlation, to -1, a perfect negative correlation. 0 means there is no correlation. » Continue Reading…

Looking Back at 2013 CaBi Data

Flickr Calend'rWhat were the best photos of 2013? Flickr’s “interestingness” rating offers one way to judge the best, based on a special sauce made up of the number of views, faves, and comments. I wrote Flickr Calend’r for discovering the best pix of the year, breaking it down into the best of each month, and displaying the results in a calendar format. The Flickr Calend’r lets you narrow down which photos to search, filtering by user (or group), a search term, a WOE code, or others.

Oh, yeah, “WOE code” – not a commonly-known term. A Yahoo invention, which they normally call WOE IDs, for Where On Earth identifiers. Read Using “Where on Earth” Codes in Flickr for more info. This of course works only on photos that have been geo-tagged, so using this field will greatly reduce the available pool of photos.

You can leave any of these fields blank. When you hit “get calendar” it’ll fire off a request to search each month. This takes a while. I wrote a proxy script in PHP to handle the Flickr API calls, and of course this calendar requires 12 separate calls. I’m not sure if the problem is Flickr’s slow servers, or my own. » Continue Reading…

HangmanI did something weird with the Twitter API. A while back I used tweets to form the word puzzles for a Hangman game. You can feed the puzzles from a user’s stream by putting the user’s twitter handle in the URL, like ?twitter=mvs202. Oddly enough, this cool game never went viral, and it sat unloved and unplayed for a long time. When I tried it myself recently, it had stopped working. Here’s what happened and how I fixed it.

The original Twitter did not require authentication for the most basic searches. The API handled API calls just like it handled web searches, so the API version of twitter.com/search?q=test was simply search.twitter.com/search.atom?q=test. This worked great back when I wrote Game-ifying Twitter with Hangman two years ago. The new API requires developers to sign up. Plus, the response format has been totally changed to improve object consistency.

I wrote the game before discovering the joys of AJAX. Back then I consumed synchronous APIs by making the whole program in PHP. That means that the web page doesn’t render until the API call is complete so the server can wrap up the HTML code. Not a problem with Twitter, which has a speedy API, but still. The bigger problem is the readability of my own code. Mingling HTML and PHP makes for a difficult read, made worse by having “echo” statements generating HTML and Javascript on the fly. » Continue Reading…

Updating the API Approach

Arlington Bike Counts, Activity MapperArlington has a collection of automated trail counters which can distinguish between pedestrians and bikes, and can also record the direction of travel. This data is transmitted live to a database, managed with Eco Counter software. I recently got access to the data and was able to experiment with how to visualize it. I decided to add it as a dataset to my new Activity Mapper, which lets you animate and interact with a chronological and geographical data set.

For each coordinate, Activity Mapper lets you compare two numbers. For Metro it was entrances and exits at each station. For Capital Bikeshare it was bikeins and bikeouts at each station, and grew to include datasets comparing casual riders to registered riders, and trips that fell within or beyond the 30-min time limit. For my first look at Arlington’s trail counters, I chose to look at the past year of bike traffic (excluding pedestrian traffic), broken down into 365 days. The two data sets compare “trips in” to “trips out,” refering to the direction of the bike. Unfortunately, this version does not yet indicate the direction in the display. » Continue Reading…