Data insights for cities and better rides for users
By: Joe Gomez
Bikers can download the Ride Report app for iOS and Android and start tracking miles, mapping routes, and earning trophies. Beyond route tracking, Ride Report has a greater mission — they are using our tools to visualize patterns in biker behavior and help cities improve bike infrastructure. Their partners receive access to a web analytics tool that lets planners explore Ride Report’s custom map and data layers. Michael Schwartz, Director of Transportation Planning, explained how they’ve scaled with our stack.
What are the challenges you faced initially to collect and visualize bike route data?
The idea behind Ride Report was to identify trends in route behavior by aggregating data across a high number of trips and street segments. In the beginning when we only had a small number of trips as inputs, GPS noise clustered around sensible patterns. As soon as the app collected more than 1,000 trips, we needed a new approach to snapping the many millions of GPS points to the street grid.
We then wanted to visualize aggregate data to our public users through our comfort map, which shows the most comfortable and most stressful routes in a city on a block-by-block level. This is available to our mobile users for wayfinding purposes and also available to partner cities in a paid client dashboard via desktop browser. We tried using a couple of other solutions, but the performance was too slow.
What was the solution for handling all of that GPS data?
The Mapbox supported Open Source Routing Machine (OSRM) was a godsend for normalizing all of the noisy GPS traces to a set of street segments. Not only could we show useful data to our mobile users but also create a paid product, providing cities with a web-based, point-and-click dashboard. Planners use the dashboard to manipulate the GPS data and draw conclusions about how the bike network is used.
Mapbox GL made the loading of all the information in real-time possible — it raised the bar. Also, the fact that Mapbox uses the same API across the desktop browser, iPhone, and Android platforms saves us a ton of time and motivates us to make improvements. Because the style rules and data sources are also compatible across platforms, we can design the map view once and then re-use on each platform. If we had to make these improvements separately, we may not have done many of them.
How did you approach building maps for the web analytics tool and mobile apps?
On the frontend, we use Mapbox GL for all of our maps — web, iOS, and Android. We use a custom set of style rules to show bike routes and to overlay our stress data on the base map. The base map is made using the Mapbox Streets vector tiles, which are themselves based on OpenStreetMap data. We use the geojson-vt and vt-pbf modules to generate vector tiles of our stress data.
Mapbox GL’s ability to handle huge GeoJSON files is transformative. Our backend engineer didn’t believe geojson-vt’s capabilities were possible until he saw it in action. It would have taken a lot of effort and customization to develop something similar in house. This wouldn’t have been possible given the constraints of our business and team size.
The app knows when you’re riding. Tell us about the user experience.
We use the smart phone accelerometer to determine mode which uses a much lower amount of power than GPS. We trained the app by carrying the phone on different modes of transportation. It’s not perfect, but it gets more accurate all the time as our users send us error reports, allowing us to improve the machine learning algorithm. Even the biggest stat tracker will forget to push start and stop, so we created something that would help bikers track rides automatically.
Users also rate trips right from their lock screens, so sending data to the larger cycling community, bicycle planners, and city decision makers isn’t a chore. We wanted the app to feel like it’s a natural part of riding a bike, not something that pulls you out of that lifestyle.
What’s on your roadmap, any other features of our stack you plan to explore?
In the medium term, we will combine our stress rating data with other route information to create a user-customized, turn-by-turn direction service. This would involve custom profiles on OSRM and also the Navigation SDK.
We also plan to use more of Mapbox GL’s interactivity so users can create their own trophies and rewards in the app. Imagine if you could challenge your friends or the public at large to bike to work at least ten times in a given month and then create virtual or even real rewards for achieving it.
Ride Report users have logged over 4 million miles biked, and the app is powering insights in cities like Portland, Oakland, Austin, and Atlanta. Building a mapping application that’s leveraging large location datasets and custom inputs from users? Reach out to sales about building with our tools or hit us up on Twitter, @Mapbox.
Ride Report bike route tracking was originally published in Points of interest on Medium, where people are continuing the conversation by highlighting and responding to this story.