Sitemap
Evgeny Arbatov

Evgeny Arbatov

I let my mind wander.

Better OSRM Routes

2 min readJul 17, 2024

OSRM recommends the shortest route between start and destination. This may not be the route you want to take when going out for a walk or a run. OSRM simply has no way of knowing your preferences.

Is there a way to create routes with OSRM which take into account the streets and places you like to visit? One approach is to create custom OSM ways which represent your favorite routes.

You can use heatmaps Garmin Connect or Strava to get popular GPX tracks. To connect GPX files with the OSM map you need to know which OSM nodes are present in the GPX files. This will allow adding new OSM ways to make OSRM prefer your GPX routes.

Here is an example of what you can achieve with this approach:

Press enter or click to view image in full size
Press enter or click to view image in full size
Press enter or click to view image in full size

You can see details of how to get this done in my Github repo.

Get Evgeny Arbatov’s stories in your inbox

Join Medium for free to get updates from this writer.

This is what you need to get started:

  • OSM extract for your city / area you are planning to run in
  • Set of GPX files which represent your favorite routes

On a high-level, these are the steps:

The results are not perfect but it’s a good start.

--

--