Routing (in some countries called navigation) services help people get from one place to another. OpenStreetMap data includes information for routing by many modes including car, foot, bicycle and horse. There are many offline, embedded and web-based routing services using OpenStreetMap data.
For developers this page provides advice on software available for creating new routing applications/deployments and details key OpenStreetMap data that can be used to create better routing engines. A number of mailing lists are also available.
- 1 End users: Routing software
- 2 Mappers: Improving the map data
- 3 Developers
- 3.1 Desktop and server software
- 3.2 Mobile device software
- 3.3 Libraries/development tools
- 3.4 Highway-type
- 3.5 Average speed
- 3.6 List of other tags giving routing hints
- 3.7 Lanes
- 3.8 Sinuosity
- 3.9 Inclines
- 3.10 Highway condition
- 3.11 Obstacles and other conditions requiring special consideration
- 4 Mailing lists
- 5 See also
End users: Routing software
See also: List of OSM based Services#Routing
- simply on the OSM homepage (blog post with description)
- Routing/online routers – There are many websites that use OpenStreetMap data to provide online route planners; those with global support are featured below.
- Routing/offline routers – Furthermore several options exist for installing offline navigation software on your handheld device or laptop.
- Navigation apps are available for Android, Apple iOS, Java ME (J2ME) and Openmoko. For other mobile platforms see Software#Mobile Devices.
Mappers: Improving the map data
For routing software to work well, the underlying map data must be of good quality. Essentially this means that ways that should be connected are in fact connected, one-way roads are tagged, turn restrictions are mapped, and so on. You should be familiar with the Map Features used, in particular see OSM tags for routing to understand the tags specific to routing.
Fixing bugs with MapDust
Many of the bugs on MapDust have been added directly from within iOS or Android navigation apps. This makes it a good place to look for improvements to the map data. Some bugs are specifically about one-way roads or turn restrictions, and are marked as such.
Look out for many "poor routing" or "other" bugs in a small area as this may indicate that thre is a missing connection between ways. In Potlatch when you select a way you will see all the nodes highlighted. If a node is big and square then it is connected to another way. To improve the quality of OSM data you can use also the reports generated by WayCheck.
Note: Try unchecking the "Hide bugs with default text" on mapdust as many users do not change the default text whilst using the navigation app.
In order to better calculate the fastest route, please consider helping by adding speed data using the maxspeed=* tag. This is especially important where the speed limit differs from the assumed maximum permitted speed for the road type per country and vehicle-type.
- Note: ITO World provide a number of services to help identify missing speed limits.
See also #Average speed.
Checking your fix
After you have fixed an error on the map you will need to wait until the revised version of the map propagates into the routing engine you are using. This delay will depend for each engine on:
- how often it get updates from the database
- how long it needs to update its internal database.
In the case of OSRM used on the map front page it usually gets updates twice a day and then spends 10-12 hours processing the updates. This gives a total delay of anything from 10 to 24 hours from your fix being saved to the map, to working in OSRM.
Desktop and server software
- The Traveling salesman routing-application contains the osmNavigation -library for doing all the basics except a user-interface. All important parts can be exchanged via plugins.
- OpenTripPlanner site is a multi-modal trip planner supporting OSM data. OTP Deployer makes it easy to deploy your own routing instance.
- GraphHopper is a Java routing engine for (road) networks. Fast and memory efficient (for Android, iOS, desktop and server).
- BRouter focuses on bike routing and features elevation awareness, alternatives, fully configurable routing profiles and offline routing initially written for Android, but has now also a web api
- Atlas is a Java map and navigation application using offline vector maps.
- Open Source Routing Machine
- Routino Flexible router with user selectable routing preferences.
- IMORTIS(Intermodal Transport Routing Informations-System) is an approach to route/optimize transport routes via different vehicles using a optimized A* Algorithm
- OsmSharp Library for routing and transportation optimization problems.
- Simple Map Routing Demo routing program (using optimized double A* Algorithm) with SQLite and OSM uploader.
- osm_routing super-simple plain Dijkstras
- Mormon ruby version of pyroutelib
Mobile device software
- OsmAnd OSM Map, POI and Routing (car/bike/foot, online&offline) for Android
- ZANavi Android
- Navit Linux, Windows and portable devices
- GraphHopper Android and iOS. Routing engine library.
- BRouter focuses on bike routing and features elevation awareness, alternatives, fully configurable routing profiles and offline routing for Android
- OpenTripPlanner_(Android) is an Android app for multi-modal trip planning using any OpenTripPlanner server
- Cruiser is an Android map and navigation application using offline vector maps.
Libraries focused on OSM Routing can be found at Develop/Frameworks. Here some general libs:
- DGLib Directed Graph Library used by Grass's vector network tools (shortest path, traveling salesman, isodistances, Steiner trees; also Addons)
- Graphserver is a webservice providing shortest-path itineraries on TIGER/line road maps, and public transport data in the General Transit Feed Specification format
- pgRouting - PostGIS-based routing engine. Special tool osm2pgrouting for importing OSM data to internal graph structure. Works directly on top of SQL database tables.
- Libosmscout offers simple, high-level interfaces to offline rendering and routing functionalities based on OpenStreetMap data
- Spatialite Spatialite has its own routing engine VirtualNetwork and a spatialite_osm_net tool for building a routable network directly from OSM data. Routing can use either Dijkstra or A* algorithm.
- GraphHopper routing engine with Java API.
- The default-protocol is the API v0.6 spoken by the main servers. If can contain all data there is in OSM. Get Planet.osm dump.
- There is also a compressed but limited OSM Mobile Binary Protocol.
The order of values for the highway-tag ordered by assumed speed is:
- living_street / service
OpenStreetMap data will need average speed values in order to give realistic time estimates for routing.
- Proposed_features/Practical_maxspeed is a rejected but nevertheless used way to tag adhoc average speed values in areas where official speed limits are largely meaningless and road/track type information insufficient to derive meaningful travel speed estimates.
- Speedcollector is a currently defunct service to collect real-world measurements, while it might be possible to derive average speed per way from stored tracks.
- Global Statistical Speed Matrix is a proposed concept to extract speed information from NMEA/GPX tracks and store them efficiently in a database to make collected data useful for routing purposes.
- see also hiking
The number of lanes of a highway is directly tagged in OSM and has a major influence on the average speed (fastest route) and fuel-consumption (most efficient route).
In some studies about the accessibility  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).
On the other hand, geographical approaches like that of the space syntax presuppose that, in urban environments, pedestrians and drivers are influenced at the moment of choosing theirs paths for the visibility of the route. In this respect a pedestrian who moves, for example, from the point A to the point B will select principally wide and rectilinear streets, squares or avenues with a wide visual field, avoiding crossed by winding and narrow streets, even when the latter route is somewhat shorter.
Same as curves, inclines may decrease the speed of your vehicle.
Other factors, in our case more difficult to measure, which determine the average speed are the width of pavement, condition of the network (roadworks, surface type and surface smoothness - especially in ex-USSR), Levels of Service (LOS), minimal radius curve, banked turns, visibility based on curves and gradients, etc.
Obstacles and other conditions requiring special consideration
- route=ferry - delays, cost, operating times
- toll=* - cost, possible delays
- bridge=movable - delays, operating times
- highway=speed_camera - may indicate very busy or accident prone areas
The following mailing lists are relevant to routing
- osm-routing 'Discussion about Routing with vector Data. Especially concerning OSM Data'
- osm-accessibility For all kinds of disabilities this concerns the proposal and use of tags that are of special interest for disabled persons. Special maps shall be created with this data.
- OSM tags for routing - What data is stored in OpenStreetMap that you can use when routing?
- CartoType, cartotype.com
- Rollstuhlfahrer-Routing - German project for wheelchair routing
- Routing problems - Are there any problems that can't be solved using least-cost routing? Do we have any suggestions for solving those problems?
- Routing profiles - Which categories of people want to generate routes, and what are their specific needs? What weights 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 tires and no lights at night?
- Sample driving instructions
- TIGER fixup - Fixing routing in the U.S. Starting with basic interstate routes: TIGER fixup/250 cities
- Train routing- How can we do routing on public transport networks, and other scheduled services?
- LoroDux - Pedestrian routing for mobile devices for the blind
- Taxi to... - a funny approach to long-distance routing comparison
- Video: Google Tech Talk - Peter Sanders - Fast Route Planning