MapQuest’s bike routing API uses OpenStreetMap data to preferentially route cyclists on bike facilities. It works well when the data is complete and connected, but fails completely when the data isn’t there. This tutorial shows how you can help complete the data.
OpenStreetMap (OSM) is the “map Wiki” that uses crowd-sourced data. Since I’ve starting using MapQuest’s bike route API with my map client, I’ve run across dozens of areas where bike paths have been entered into OSM, but the paths aren’t actually connected to adjacent routes. For routing software to use those paths, it has to know where those paths can be accessed from nearby roads. If the connections are missing in the map data, the routing algorithm can’t send you on the path.
This brief tutorial shows how you can modify existing path information to add those connections.
Lisa in Wellington, New Zealand brought my attention to the Waterfront Cyclepath there. Here’s an example of a route that routes cyclists over very busy streets when most local cyclists would probably prefer the adjacent cyclepath. Why did MapQuest fail to use the cyclepath? Let’s take a look.
I’ve highlighted the “Edit this map: OSM” button in this screenshot. Click that to get a view of what OSM knows about this area.
In OSM, you can select “Cycle Map” from the views available by clicking the plus (+) sign near the top right part of the map. In this view, cycle paths are dashed blue lines. You can see the Waterfront Cyclepath is already in the map along Oriental Parade.
To edit this map, you need to an OSM account. Click “sign up” and follow the instructions. Unlike most crowd-sourced / open source projects, OSM has you click a contributor terms agreement in which you pledge that your data does not come from copyright sources. If you agree, click through and continue.
Once you return to the map view, hover your mouse over the “Edit” tab and select “Edit with Potlatch-2.” For the Waterfront Cyclepath, I zoomed to the eastern end of the path, clicked on the path and saw it doesn’t connect to Oriental Parade. The yellow highlighted line (a “way” in OSM parlance) shows the cyclepath; the red dots are “nodes” on the “way.” You can see where it stops just short of connecting with Oriental Parade.
To connect the cyclepath to the road, I extend the path by clicking on the red dot at end of the line. I draw a line from the end of the path and hover my mouse over Oriental Parade. Potlatch (the map editor) shows that I’m on Oriental Parade by highlighting its nodes — the blue dots in this screenshot.
I click a new node over Oriental Parade and the cyclepath way has been extended and connected to Oriental Parade. Press “ENTER” to complete the edit.
I then pan the map west over the length of the cyclepath and add additional street connections at intersections, parking lots, and nearby park trails. You add these additional ways with a shift-click in the middle of the cyclepath at the intersection to create a new node, then click either at an existing node on the street or click in the middle of the street to create a new way.
In this example, I’ve added a new way to connect the cyclepath to Grass Street’s intersection with Oriental Parade. Since I created a new way, I must also tell OSM what kind of way this new line is. I do that by clicking in the “tag” box(the big menu on the left), selecting “Paths” and then selecting either “Generic Path” or “Cycle Path” as appropriate. MapQuest will accept either as a bike facility with their bike routing API.
Once you’re done, you must then click “Save” at the top right of the editor. The data becomes part of OSM within a day or four, and MapQuest will know the new route within another day or two.
You can see my complete list of edits along the Waterfront Cyclepath in Wellington here, if you’d like. I connected both end of the path to nearby streets, added connections at a number of street intersections, and connected the path to parking lots and park trails as well. Although I’m in California, this was easy because the path was already input and satellite imagery provided by Bing / Microsoft clearly shows path access points.
I know there’s another path that extends north out of Wellington from Aotea Quay. Unfortunately, that path info is not in OSM, and the Bing imagery isn’t clear enough for me to distinguish it from the various other physical features in that area. For that path, somebody on the ground will likely need to track this with GPS and upload the path track to OSM. If you’re in New Zealand and would like to help your fellow cyclists, read these instructions. You should also read the OSM New Zealand Project page.
I hope this encourages you to contribute to OSM. It can be a valuable resource for cyclists when the cyclepath database becomes complete.