Skip to content
halkoma edited this page Jul 31, 2020 · 9 revisions

NOTE: a more up-to-date version of this document can be found here

OSRM supports "profiles". Configurations representing different routing behaviours for (typically) different transport modes. Think car or bike routing. A profile describes whether or not we route along a particular type of way, or over a particular node in the OpenStreetMap data, and also how quickly we'll be travelling when we do. This feeds into the way the routing graph is created and thus influences the output routes.

Available profiles

Out-of-the-box OSRM comes with several different profiles, including car, bicycle and foot. Check the profiles directory. You have to pass a profile to osrm-extract:

osrm-extract -p ../profiles/car.lua planet-latest.osm.pbf

A change to the profile will typically affect the extract step as well as the contract step. See Processing Flow.

Profiles are written in the Lua scripting language. The reason for this, is that OpenStreetMap data is not sufficiently straightforward, to simply define tag mappings. Lua scripting offers a powerful way of coping with the complexity of different node,way,relation,tag combinations found within OpenStreetMap data.

Understanding Profiles

We recommend reading through the default profiles for understanding how profiles work. The main idea is this: Profiles work on OpenStreetMap objects (think nodes, ways) and pick up properties such as maxspeeds, road width, lanes, barriers, etc. and use them to influence the internal graph structure.

There are two minimal profiles we're using for our testing infrastructure. They provide a good introduction to how profiles have to look like.