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.
- Use Intellij IDA for running the code (https://www.jetbrains.com/idea/).
- Download the data files in data folder.
- You need opencsv 1 or 2 to work with csv files. You can use this as a guide. It is not necessary to add as a native library.
This version has the following modifications.
- The class ghDMV searches for fastest route for all trips in the DMV region.. This is your main gh class to run in IDE.
File -> New -> Project from Version Control
paste the repository url and hit 'clone'. IntelliJ usually figures out
that the project is a maven project. If not: Right click on pom.xml -> import as maven project
.
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. Please do not use our issue section for questions :)
Read through how to contribute for information on topics like finding and fixing bugs and improving our documentation or translations! We even have good first issues to get started.
To get started you can try GraphHopper Maps, read through our documentation and install the GraphHopper Web Service locally.
- 8.x: documentation , web service jar , announcement
- unstable master: documentation
Click to see older releases
-
See our changelog file for Java API Changes.
-
7.x: documentation , web service jar , announcement
-
6.x: documentation , web service jar , announcement
-
5.x: documentation , web service jar , announcement
-
4.x: documentation , web service jar , announcement
-
3.x: documentation , web service jar , announcement
-
2.x: documentation , web service jar , announcement
-
1.0: documentation , web service jar , Android APK , announcement
-
0.13.0: documentation , web service jar , Android APK , announcement
-
0.12.0: documentation , web service jar , Android APK , announcement
-
0.11.0: documentation , web service jar , Android APK , announcement
-
0.10.0: documentation , web service zip , Android APK , announcement
-
0.9.0: documentation , web service zip , Android APK , announcement
-
0.8.2: documentation , web service zip , Android APK , announcement
-
0.7.0: documentation , web service zip , Android APK , announcement
To see the road routing feature of GraphHopper in action please go to GraphHopper Maps.
GraphHopper Maps is an open source user interface, which you can find here. It can use this open source routing engine or the GraphHopper Directions API, which provides the Routing API, a Route Optimization API (based on jsprit), a fast Matrix API and an address search (based on photon). The photon project is also supported by the GraphHopper GmbH. Additionally to the GraphHopper Directions API, map tiles from various providers are used where the default is Omniscale.
All this is available for free, via encrypted connections and from German servers for a nice and private route planning experience!
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. See version 1.0 with still an Android demo and 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
To support these high precision reachability approaches there is the /spt endpoint (shortest path tree). See #1577
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 regarding changing properties per request or e.g. integrating traffic data. Furthermore, this hybrid mode is slower than the speed mode, but it is an order of magnitude faster than the flexible mode and uses less RAM for one request.
If the preparations exist you can switch between all modes at request time.
Read more about the technical details here.
We chose the Apache License to make it easy for you to embed GraphHopper in your products, even closed source. We suggest that you contribute back your changes, as GraphHopper evolves fast.
OpenStreetMap is directly supported by GraphHopper. Without the amazing data from OpenStreetMap, GraphHopper wouldn't be possible at all. Other map data will need a custom import procedure, see e.g. Ordnance Survey, Shapefile like ESRI or Navteq.
GraphHopper is written in Java and officially runs on Linux, Mac OS X and Windows.