Nov 8, 2010

It’s Here – Bicycle Routes Using OpenStreetMap Data!

We’re pleased to announce our latest service for the MapQuest Open Initiatives project: Bike Routes! Temperatures are dropping but fair weather cyclists, take your bikes out and enjoy the beautiful cool crisp autumn air! It is never too late in the season to go biking.

If you’re already familiar with the Open Directions Service, then you’ll know that this service is based entirely on OpenStreetMap data. You’ll also find that adding bike routes to your directions search is extremely easy to implement. For example, if you were searching for directions from Thoreau Middle School in Vienna, VA, to Idylwood Park in Falls Church, VA, you would say:

http://open.mapquestapi.com/directions/v1/route?key=YOUR-KEY-HERE&from=38.88866,-77.241899&to=38.89162,-77.211376&routeType=shortest

Simply change routeType=shortest to routeType=bicycle.

http://open.mapquestapi.com/directions/v1/route?key=YOUR-KEY-HERE&from=38.88866,-77.241899&to=38.89162,-77.211376&routeType=bicycle

Here’s a comparison of the results for the same route. Note the difference as the bike route option attempts to provide a more bike friendly route by avoiding major roads and even jumps on the W&OD Trail, a popular paved multi-use trail in Northern Virginia!

Directions using routeType=shortest.

Directions using routeType=bicycle.

If you’re asking yourself, “what does MapQuest mean when they claim a more bike friendly route?” Well, we will route you on paths that are not vehicle accessible and also try to not let you do anything illegal, like riding on an interstate : ) On a more serious note, the following list provides some specific rules that are applied to bike routes:

  • Avoids roads where bicycle access in OpenStreetMap is set to false
  • Avoids all limited access highways
  • Favors bike specific paths (road segments that have bicycle access only – no auto or pedestrian)
  • Favors walkways with no auto access
  • Applies various weights to roads based on the maxspeed tag (ex. favors routes where maxspeed <= 30 mph)

Elevation chart combining the Bike Routes with the Open Elevation Service.

Continuing with the Open theme, bike routes can also be combined with the Open Elevation Service. Remember, it’s still in Beta and we’d appreciate it if you can limit the routes to less than 200 miles. (I know, we apologize – you were looking forward to biking over 200 miles tomorrow, weren’t you?)

Similar to all our other Open Services, no AppKey is necessary! What you will need, however, is a collection of lat/longs along its route to produce the elevation chart. Fortunately the above Open Directions request can provide the coordinates for us. With this info in hand, we can request Elevation with the following:

http://bit.ly/bmtuBS

The elevation chart is heavily dependent on the generalize parameter for the Open Directions Service. As you might expect, the higher the generalization, the more simplified the elevation chart becomes. Check out the Developer’s Guide to read more about the generalize parameter and shape simplifications under Advanced Routing Options and Parameters. And definitely stay tuned for more details regarding the Open Elevation Service!

Follow @MapQuestTech on Twitter

MapQuest DevBlog RSS

Want to stay updated on all the latest advances? Subscribe to our blog feed and be among the first to receive the news!