Open Trail Map

I spend time outdoors climbing, hiking and running. When researching a new area or trying to find a new spot to explore, I've often wished there was a Google Maps equivalent for trails. I also think it's incredible what OpenStreepMap has accomlished as an open source project - it's really a viable alternative to Google Maps in many cases. That's why I started building Open Trail Map - a site that allows you to explore trails anywhere in the world through a simple and intuitive interface.

Inspiration

Google Maps is great for getting directions, planning a day in a new city or even getting a feel for a place using Street View or the geo-tagged photos. And the user interface is great. (Although switching to terrain view has become less obvious.) But when you want to leave the pavement behind, Google Maps doesn't help as much. You may find the trial you're looking for, but many smaller trails are missing and very little information is provided.

For detail and completeness, nothing beats a topographic map, like this beauty from Switzerland:

But to explore new areas or get a quick overview, the web is an excellent medium. In fact, Switzerland has made serious progress getting topographic data online, but most countries aren't even close. Of course, there is plenty of hiking and trail information available online (see for example: allTrails, summitpost.org or Trail Run Project), but they offer an exerience analagous to a guidebook: lots of detail, descriptions, and opinions spread across many pages. If you want a web equivalent of a topo map, you're out of luck (unless you live in Switzerland!). To help change that, I started building Open Trail Map. Here is what I had in mind:

Goals

A single page interface

Topographic map baselayer

Highlight anything that might be called a "trail", including foot paths, dirt roads or bike paths.

Structure

To make an online trail map, we need trail data and fortunately OpenStreepMap already contains data on lots of trails. (Many are still missing, but more on that later.) There are also open source web mapping frameworks that make it easy to build an interactive online map. I used Leaflet. The bulk of this project involved stitching together these various components into a working application. Leaflet provides the interactive map interface. Mapbox provides the base imagery, courtesy of OpenStreetMap. The trail data is loaded from Overpass, the OpenStreetMap API, and Google Maps Javascript API is used to get trail elevations and search for new locations. All of the code is available on Github: github.com/mikeskaug/OpenTrailMap.

Areas for Improvement

OpenStreetMap has an extensive lexicon to specify different geographic features. If you poke around, you'll find that trails, dirt roads and bike paths are classified as "highways" of type "path", "track" and "cycleway", respetively. At this point, those are the only features loaded by Open Trail Map. It could be that other features, such as public transport, would be of interest.

Trail data is displayed as it exists on the OpenStreetMap database. As a result, there are gaps in coverage and many trails are fragmented and depicted as seperate trails. The coverage will improve with time as more users contribute data on their local trails. But the fragmentation is tricky. Topological analysis could re-link some obvious breaks, but there are going to be many ambiguous cases. The best would be to have data density like Strava in order to link trails based on actual use.

Loading data from the OpenStreetMap API is slow!. That's why Open Trail Map does not dynamically load new data as you pan/zoom the map. This is a big problem for the user experience. I can think of a couple workarounds, but none seem really satisfactory. The real solution will probably involve significant back-end engineering, developing a dedicated database, delivering different data depending on the zoom-level, etc.

No information is provided on current trail conditions. Frankly, I haven't thought of a good data source for trail conditions. Incorporating weather data would be straightforward and is probably worth doing, but it doesn't tell you that the trail is shaded and still covered in ice or that it feels like a blazing furnace from 10am-4pm. Pull recent geotagged Tweets? Are there webcam APIs?