GraphHopper is a fast and memory-efficient routing engine released under Apache License 2.0. It can be used as a Java library or standalone web server to calculate the distance, time, turn-by-turn instructions and many road attributes for a route between two or more points. Beyond this "A-to-B" routing it supports "snap to road", Isochrone calculation, mobile navigation and more. GraphHopper uses OpenStreetMap and GTFS data by default and it can import other data sources too.
We have an open community and welcome everyone. Let us know your problems, use cases or just say hello. Please see our community guidelines.
All questions go to our forum where we also have subsections specially for developers, mobile usage, and our map matching component. You can also search Stackoverflow for answers.
Read through our contributing guide for information on topics like finding and fixing bugs and improving our documentation or translations! We also have good first issues to get started with contribution.
To get started you can try GraphHopper Maps, read through our documentation and install GraphHopper including the Maps UI locally.
See the changelog file for Java API Changes.
Click to see older releases
To install the GraphHopper Maps UI and the web service locally you need a JVM (>= Java 17) and do:
wget https://repo1.maven.org/maven2/com/graphhopper/graphhopper-web/11.0/graphhopper-web-11.0.jar \
https://raw.githubusercontent.com/graphhopper/graphhopper/11.x/config-example.yml \
http://download.geofabrik.de/europe/germany/berlin-latest.osm.pbf
java -D"dw.graphhopper.datareader.file=berlin-latest.osm.pbf" -jar graphhopper*.jar server config-example.yml
After a while you see a log message with 'Server - Started', then go to http://localhost:8989/ and you'll see a map of Berlin. You should be able to right click on the map to create a route.
See the documentation that contains e.g. the elevation guide and the deployment guide.
The Docker images created by the community from the master branch can be found here
(currently daily). See the Dockerfile for more details.
The GraphHopper routing server uses GraphHopper Maps as web interface, which is also open source.
To see GraphHopper Maps in action go to graphhopper.com/maps/, which is an instance of GraphHopper Maps and available for free, via encrypted connections and from German servers - for a nice and private route planning experience!
The GraphHopper Directions API is our commercial offering that provides multiple APIs based on this open source routing engine: the Routing API, the Matrix API, the Isochrone API and the Map Matching API.
It also provides the Route Optimization API, which is based on our open source jsprit project and uses the fast Matrix API behind the scenes.
The address search is based on the open source photon project, which is supported by GraphHopper GmbH.
There is a web service that can be consumed by our navigation Android client.
Offline routing is no longer officially supported but should still work as Android supports most of Java. See version 1.0 with the Android demo and also see this pull request of the iOS fork including a demo for iOS.
Use isochrones to calculate and visualize the reachable area for a certain travel mode.
You can try the debug user interface at http://localhost:8989/maps/isochrone/ to see the /isochrone and /spt endpoint in action.
There is the map matching subproject to snap GPX traces to the road.
GraphHopper supports several routing algorithms, such as
Dijkstra and
A* and its bidirectional variants.
Furthermore, it allows you to use
Contraction Hierarchies (CH)
very easily. We call this speed mode; without this CH preparation, we call it flexible mode.
The speed mode comes with very fast and lightweight (less RAM) responses and it does not use heuristics. However, only predefined vehicle profiles are possible and this additional CH preparation is time and resource consuming.
Then there is the hybrid mode which also requires more time and memory for the preparation, but it is much more flexible regardin
$ claude mcp add graphhopper \
-- python -m otcore.mcp_server <graph>