Routing
From OpenStreetMap
Contents |
Introduction
This page is a reference to find all you need to know to implement a route-planning or navigation -program on top of the OpenStreetMap.
We assume you are already familar with doing routing at all and may even have an existing routing-application that currently uses other maps.
For discussion about your ideas about routing, see the osm-routing mailing-list.
For discussion about the content of this page and linked pages. Please consult the "discussion"-link on top of this page and add a new topic. (Do not forget to sign your entry with name+timestamp using --~~~~. Thank you.)
Existing software
The following applications are known to be able to use openstreetmap-data for routing:
- RoadMap ([1]) is a promising PDA and desktop navigation software, which is open source and uses TIGER for US data, and (as of 2006) vmap0 data for the rest of the world. The RoadMap trunk does not yet support autorouting, but has speech synthesis (for street names, etc). Ehud Shabtai's
- FreeMap Israel ([2]) fork of RoadMap which is in active development, has support for autorouting and has been ported to PocketPC and J2ME mobile phones in addition to the systems supported by RoadMap. It also has an interface which is more adapted to the small displays on mobile phones and PDAs.
- VGPS ([3]) J2ME application with GPS Tracking, AutoRouting, In Car Navigation and Voice Guidance. It supports routeable vector maps and uses A* algorithm for AutoRouting.
- Roadnav ([4]) is another valid alternative, although contrary to RoadMap it offers no PocketPC support as of yet, and only supports TIGER data, although Digital Chart of the World (DCW) support is planned. It does support autorouting, however, and 3D views and aerial photos (wow!). The newest release of Roadnav has preliminary OSM support.
- Traveling salesman ([5]) is a rather new one. Mostly interesting for java-developers at this point.
- Gosmore - Viewer of OSM XML data such as the planet.osm with routing functionality.
- Navit - GPL Car navigation, written in C. Routing and voice navigation in 10 languages.
- pyroute can route for different types of vehicle (bike, foot, etc), uses A* with weightings, and has a basic GUI
- PHProute (version 0.2alpha) can route car like map24 or other routeplaner, using a modified A* algorithm from pyroute. (under development)
- GpsMid - [[6]] mobile (j2me) offline vector map application with city scale routing
- OpenRouteService ([7]) - Is much more than a website with a route service for car, pedestrians and bicycles based on Open Standards and OpenStreetMap data ...
- pgRouting ([8]) main objective is to provide routing functionality to PostGIS / PostgreSQL. pgRouting is part of PostLBS, which provides core tools for Location Based Services (LBS) as Open Source Software (OSS).
- Graphserver ([9]) is a webservice server providing shortest-path itineraries on large graphs. Graphserver currently comes packaged with scripts to load TIGER/line road maps, and transit data in the Google Transit Feed Specification format, though grapsherver is by no means limited to these formats.
- CartoType ([[10]) is a renderer and routing application. Available now for Windows, Windows Mobile (WinPDA), Symbian OS, and Palm OS 5.
- Web based routing service is a webservice for route planning combining existing services and software like Namefinder, Gosmore routing engine and OpenLayers slippy map interface. Routes can be downloaded as GPX file. A route altitude profile is also available.
- We-Travel [[11]] Routing software for Java-Enabled phones
- OpenStreetRouting [[12]] A simple online routing app using Pyroutelib2 and tile data server
Wiki pages about routing
What data is stored in OpenStreetMap that you can use when routing?
Who categories of people want to generate routes, and what are their specific needs? What weightings should we use when a 'horse who's scared of traffic lights but likes walking in the forest' asks for a route? How do we choose the best route for a cyclist with slick tyres and no lights at night?
Are there any problems that can't be solved using least-cost routing? Do we have any suggestions for solving those problems?
How can we do routing on public transport networks, and other scheduled services?
Getting Information for implementing routing
First of all you should be familar with the Map Features used.
For asking questions there is a mailing-list for routing on OSM.
usable Clues for route-metrics
fastest route
Please first see OSM_tags_for_routing to understand about the tags you should be familar with to do routing.
The order of values for the highway-tag ordered by assumed speed is:
- motorway
- motorway_Link
- trunk
- trunk_Link
- primary
- primary_Link
- secondary
- tertiary
- residental
- service
- track
In some studies about the accessibility [13] develop models that assume a certain speed of travel depending on the degree of sinuosity of the track and certain characteristics of this one. By means of the sinuosity index (observed line distance/expected line distance ) for every section it is possible to obtain a speed estimated according to the degree of winding of the road and type of route. The model is more precise if the excessively large arcs are avoided provided that a long curve can be equal to many small curves along a way, giving similar values of sinuosity for both routes. Some countries use these values to divide sections of roads and put speed limits (but this is not usual).
Other factors, in our case more difficult to measure, which determine the maximum speed are the width of pavement, condition of the network, Levels of Service (LOS), minimal radius curve, banked turns, visibility based on curves and gradients, etc.
In OpenStreetMap this model can be interesting for those routes where there are no data on speeds (for example: highway=unclassified). --Tony Rotondas 15:50, 17 April 2008 (UTC)
usable code
using OSM-data
Java:
- LibOSM does implement the basics of working with osm-data.
- Osmosis has code optimized for streaming the complete planet.osm through filters. It is well optimized for large data but less suitable for fetching small parts of the map.
- JOSM is an editor and thus has a lot of usefull code but it's data-format is made to hold all of the used map in memory.
Please note that apart from the OSM-Protocol there is also a OSM Mobile Binary Protocol that is much more compressed and may be sensible to use on the road, where only the bandwidth of a mobile phone is avaliable.
rendering a map
Java:
- JOSM contains code for working with coordinates and rending a graph of lines.
- traveling-salesman contains a simple map-renderer and a renderer to download tiles.
PHP
- The FreeMap rendering system, available from the Subversion archive, generates PNG images from OSM data.
doing routing
Java:
- traveling-salesman contains osmNavigation for doing all the basics except a user-interface. All important parts can be exchanged via plugins.
proposals concerning routing
The following are proposals currently in discussion or voting. They are not used and may even be completely rejected by the users.
OSM routing data layer (still in concept stage, please contribute):
- the OSM_Routing Data Layer describes how routing graphs can be generated from the OSM-Data_Primitives
- Routing With OSM Data-proposal discusses possible current routing issue with OSM data and proposes how to solve them.

