OSM bike path tutorial

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.

Wellington New Zealand Waterfront Path

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.

Wellington Oceanfront Cyclepath

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.

Wellington Waterfront Cyclepath not connected

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.

Wellington New Zealand cyclepath connected to Oriental Parade

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.

To learn more about contributing to OpenStreetMap, register for one of these free webinars by MapQuest.

5 Comments

  1. Thanks for posting a tutorial. Recently I put in nearly all the data I could think of for Ithaca. All the bike paths, walking paths, and special roads that I’m aware of now show up, though the routing software doesn’t usually choose them currently. I think Mapquest still uses shortest distance, and doesn’t allow the same extra distance that Google does (although I think Google lets you go way too far out of the way). I wish there was a slider, so you could choose up to 10% off if you mostly want a direct path but would still prefer a bike path when available, or maybe up to 50% more if you just want to go for a ride and don’t care about going direct.

  2. I think MapQuest does weight bike facilities a little, but like you I’d love a setting so that can be adjusted and I would definitely enable it in my map app.

    Go bug MapQuest about it — the developers monitor their forums and they’ve been pretty response 🙂

  3. thanks for this. I will check some bike routes in NYC and make sure they connect to the street.

  4. A slider like you describe would be quite fun to play with, but unfortunately very tricky to implement. These systems don’t do all their route calculating up front. They have a big index of pre-calculated weightings. So the slide would involve keeping a separate routing tables for each level of the slider. Tricky.

    However there is something similar to what you describe at http://www.cyclestreets.net/ It’s UK only, but have a play with it. Also it’s open source, so could be set-up for elsewhere. All powered from OpenStreetMap data, it will give you thee different routes. “Quietest”, “Fastest” and “Balanced” (not quite a slider, but different route weightings)

  5. Thanks for that info, Harry. I’ve previously looked all over at CycleStreets for the open source routing code, but haven’t been able to find it. Could you point to it?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.