Mystery Incorporated

Programming, photography, news, culture, and cartoons

home | rss | atom

Add to Google
category: programming

Animating a Group Bike Ride

April 15th, 2014 | no comments    

bikesI love animating bikesharing systems, but without GPS data it looks like people travel in straight lines, from bike-out to bike-in. So to get a better idea of how cyclists really travel across the city, I wanted to investigate mapping multiple GPS tracks.

The first step is finding data. Strava has a huge repository of bike data, but you can’t access a trips’s GPS data unless you are connected to that person, or if they otherwise grant you access. And even then when you download the GPS data the GPX file doesn’t include timestamps. You can get an idea of the potential of Strava’s data from this “Beautiful Weekend” video made by BikeArlington using VeloViewer.

I decided to try to collect my own GPS data by asking a local monthly bike ride, the DC Bike Party, to record their outing and send me the data. Their April ride attracted 650 riders, but I got only 5 responses, and one of those I had to reject for not having timestamps. But four cyclists is good enough for an experiment to learn more about the process.

The next step was data munging. One participant sent me two separate GPX files, for before and after the break at the bar. It was easy enough to merge them by taking the trkpt tags from one file’s trkseg section and adding them to the other file’s trkseg section. Another participant’s GPX file wasn’t syncing up with the others. To correct it, I just manually edited the timestamps using a global search & replace for the hour field. » Continue Reading…

Discovering Arlington History

April 7th, 2014 | 2 comments    

historyA new map lets you explore historic places in Arlington County, Virginia. I used the Arlington Historical Society‘s web site to learn about historic sites. My Arlington Historic Sites map puts all 107 points on the map. To help people get around, I’ve also included options to show Metro stations and Capital Bikeshare stations.

Some of the historic locations didn’t have exact addresses, so the markers might not be exact. (Let me know if any location should be moved.) Hopefully this is a good way to discover historic sites near you.

Metro Stations Ripe for Development

March 21st, 2014 | no comments    

Four Metro stations are scheduled to get solicitations for redevelopment this year, as reported by the Washington Business Journal. I used my Metro Places app to take a look at how much transit-oriented development they currently have. The app works by querying the Google Places API to discover businesses within a certain range of Metro stations. I used it to search for gyms, banks, clothing stores, and grocery stores within a radius of 1,000 meters, as a sample of what might be available. The four stations are Forest Glen, West Hyattsville, Braddock Road, and Largo Town Center.

Forest Glen and West Hyattsville are somewhat near each other, albeit in separate counties. The heat map below shows Forest Glen has less nearby development then its neighboring stations. West Hyattsville appears on the edge of an area shared with Prince George’s Plaza, but could benefit from places closer to the station.

» Continue Reading…

A Photo Album of Meetup RSVPs

March 20th, 2014 | no comments    

If you manage a meetup group, here’s a fun way to display the profile photos of everyone who attends one of your events.

Enter your event ID into my Meetup Explorer app, and it’ll display the profile photo of everyone who RSVP’d “yes” to your event. People without profile photos are not included. To get your event ID, just look at the URL of the event’s page. It’s the big number at the end of the URL.

The program works by using the Meetup API. I use the RSVPs call to get a list of all “yes” RSVPs, and the Groups call to get the name of the event and the name of the group hosting it. » Continue Reading…

Checking in with Kaiser Permanente’s API

March 16th, 2014 | 2 comments    

kpHere’s a simple web app that uses data from the Kaiser Permanente API. Interchange by Kaiser Permanente offers a Location API with four functions you can query. I built the KP Explorer using the Get KP Facilities List call.

I had originally planned a more robust program to demo for the Transportation + Health meetup that was co-sponsored by Mobility Lab and Kaiser Permanente, but couldn’t get the API working in time, so this app doesn’t do much more than demonstrate that the API works.

The program uses geolocation to find your location, or you can enter a place in the search field, or just pan and zoom to a new location and hit “find facilities.” If you’re in one of the 9 states (plus DC) served by KP, you’ll see their facilities. » Continue Reading…

Washington via WMATA

March 7th, 2014 | 2 comments    

Metro PlacesWhat would the Washington, DC region look like if you never went further than 500 meters from a Metro station? Well, there’s an app for that! I was inspired by a car-free friend who pointed out the difficulty of finding a Metro-accessible dentist when moving to DC. So, let’s put the Internet to work to make that simpler.

I used the Places Library of the Google Maps API to discover dentist locations for a geographic region. To connect to Metro stations, I submitted a separate search for each Metro station. Of course, “dentist” is just one option for a type of place. The API has 96 Supported Place Types, from airport to zoo.

Try the Metro Places app to discover businesses near your favorite Metro station. To make your own search, select the type of place from the drop-down list, which station you want and how many stops you’re willing to travel (I assume no one wants to transfer), and how far you’re willing to walk from the end-station. You can display the results as a collection of icons or a heat map, or both. The icons returned are part of the Places API, such as a giant tooth for dentists, and a martini glass for bars. » Continue Reading…

A Standard for Bikeshare Data?

March 2nd, 2014 | no comments    

Should the bikeshare industry adopt an open data standard? As bikesharing spreads to more cities, having a common method for accessing and analyzing data will become more important. We know that transit systems work best when agencies concentrate on their core mission. Transit agencies are not in the information technology business; all they should do is release their data to let third parties build apps that let passengers use the systems.

To use open data, programmers need to know: Where is the data? What are the files called? Which fields are available? What are the fields called?

Bikesharing systems should adopt the standard of having a “data” page which can be found by appending “data” immediately after the main URL. This is what many U.S. government web sites are doing (like,,, etc.) It would be awesome to have consistent URLs like and » Continue Reading…

Bikesharing at a Ski Resort

February 27th, 2014 | no comments    

You may visit Aspen, Colorado to go skiing, but how do you get around when visiting in the summer? We-Cycle has introduced bikesharing to this mountain town, giving residents and tourists a new option for getting around. They recently shared some trip history data with me, letting me create this short animation of how cyclists travel between the 13 stations.

» Continue Reading…

For Geo Searches, Radius: Bad; Box: Good

February 21st, 2014 | no comments    

Why do so many APIs offer geographic searches based on a single point and a radius, but not based on a bounding box using two points? Does your computer or mobile device have a round screen? If so, a radius search is perfect for you. But if your screen is rectangular, your search should be too. API designers need to wake up and realize that nobody has a round screen, and thus radius-based geo searches are vastly inferior to rectangular searches!

Here’s an example from Times Square. For a search at 42nd and Broadway, if you set the radius to be half the width of the screen, your search area would look like this green circle. On a square screen, those four corners outside the circle add up to 21% of the display (given a square display of width w, (w² – π×w²/4)/w² = 21%). For rectangular screens, it becomes higher. For example, putting a circle in a rectangle that’s twice as long as it is high means you are missing 61% of the display. This means you might not be including results that the user would expect to see. » Continue Reading…

Probing Data from Bay Area Bikeshare

February 19th, 2014 | no comments    

The San Francisco region has joined the bikesharing movement, with the introduction of Bay Area Bikeshare in August 2013. I wanted to see if I could adapt any of my CaBi tools for the “BABS” system, but their open data is too limited to be of much use. They have a System Metrics page which offers only ridership and membership data, which is not very interesting. To analyze the system we need trip history data, like Capital Bikeshare shares every quarter.

Luckily, I discovered Eric Fischer, who has been tracking station statuses since late August. Every minute, he records the number of available bikes and docks at each station. While not as valuable as trip history data, this data does let us discover when stations are either full or empty.

The data he records is a copy of the current station data, available at I had to reduce the size of the file by writing a Java program to remove redundancy and unnecessary fields. Still, storing data for a single day takes a megabyte of space for even the condensed JSON file. » Continue Reading…

Site by M.V. Jantzen
mvs202 "at"