GraphHopper Routing Engine 4.0 Released

We just released a new version of our open source routing engine and server for OpenStreetMap (OSM). You don’t know what a routing engine for OpenStreetMap is? Well, OpenStreetMap is a free digital map of the entire world and with a routing engine like GraphHopper you can make use of this data to find the best route between two places (and much more).

Since version 1.0 we are trying to build two releases per year so you can take advantage of recent improvements and new features early. Let’s take a look at the most important changes since version 3.0.

Custom Areas

We replaced and extended so called ‘spatial rules’ with what we now call custom areas. You can use custom areas to customize properties of GraphHopper’s road network in arbitrary areas. So what does this mean? In OpenStreetMap roads are represented as lines that can carry various tags to describe their properties, like the width, surface or speed limitations. GraphHopper does not keep all these tags, but rather stores certain (configurable) attributes, so called encoded values, that are derived from the OSM tags for each road. Using custom areas you can now modify the mapping between the OSM tags and encoded values depending on the location of a road. You can also create your own encoded values just based on the location. Sounds interesting? Make sure to read the documentation here.

Country Encoded Value

GraphHopper now knows the country every road is located in. Like all other encoded values you can show the country of each road along the route:

Route from France to Germany via Switzerland. The different colors in the path detail diagram represent the different countries along the road

You can not only show the different encoded values (like the country) along a route, but you can also use them to adjust the routing. If you have not heard about this feature yet make sure to read this previous blog post. Here is an example where we calculate the route between the same locations, but avoid going through Switzerland:

GraphHopper’s route when we exclude Switzerland by setting the following custom model:
{"priority": [ { "if": "country == CHE", "multiply_by": 0 }]}

… and more

This release comes with many more new features and improvements. You can always consider our changelog or follow the milestones on Github to keep track of the latest changes. Here are the most important changes of release 4.0:

  • We improved our routing for bikes (#2357, #2371, #2389)
  • We added the smoothness encoded value. It is used for bike routing by default now (#2303)
  • We improved the handling of barriers (#2345, #2340, #2406)
  • The node-based CH preparation is now about 20% faster (#2390)
  • We continued our work on supporting public transport, see e.g. #2379
  • We moved the api module into web-api (#2372)
  • We fixed a security hole in the Maps UI (#2370)
  • It is now easier to provide high precision elevation data like it is freely available for Switzerland (see this comment) via OSM tags (#2381)
  • We increased the maximum shortcut weight and improved some of our internal numerics (#2376, #2397)
  • We cleaned up our code base a lot in this release, so it will remain maintainable in the future.
  • The priority encoded value is now considered in custom weightings (#2333)
  • We improved the bbox intersection logic (#2326)
  • The isochrones demo UI now supports all profiles (#2332)
  • Now Docker images for GraphHopper are maintained by HarelM here
  • You can now export a link that includes a custom model in GH maps (#2330)
  • We migrated our comprehensive test suite from JUnit 4 to 5 (#2324)
  • We no longer maintain the stable branch. To keep track of releases after and including release 4.0 you should use the 4.x release branch instead.


Thanks a lot to all contributors:

karussell, ratrun, michaz, otbutz, Anvoker, Kirill89, OlafFlebbeBosch, gchevalier, gberaudo, matkoniecz, easbar

Try it today

You can try the GraphHopper routing engine via GraphHopper Maps or install it locally. We publish it under the Apache License 2.0 so it is free to use.

Happy routing!