- Notifications
You must be signed in to change notification settings - Fork0
An open source route planning library and server using OpenStreetMap.
License
otbutz/graphhopper
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
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 andmore. GraphHopper uses OpenStreetMap and GTFS data by default and itcan importother data sources too.
We have an open community and welcome everyone. Let us know your problems, use cases or justsay hello. Please see ourcommunity guidelines.
All questions go to ourforum where we also have subsections specially for developers, mobile usage, andour map matching component. You can also searchStackoverflow for answers. Please do not use our issue section for questions :)
Read throughhow to contribute for information on topicslike finding and fixing bugs and improving our documentation or translations!We even havegood first issues to get started.
To get started you can tryGraphHopper Maps, read through our documentation and install the GraphHopper Web Service locally.
- 9.x:documentation,web service jar,announcement
- unstable master:documentation
Click to see older releases
See ourchangelog file for Java API Changes.
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 install theGraphHopper Maps UI and the web service locally youneed a JVM (>= Java 17) and do:
wget https://repo1.maven.org/maven2/com/graphhopper/graphhopper-web/8.0/graphhopper-web-8.0.jar https://raw.githubusercontent.com/graphhopper/graphhopper/8.x/config-example.yml http://download.geofabrik.de/europe/germany/berlin-latest.osm.pbfjava -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 tohttp://localhost:8989/ andyou'll see a map of Berlin. You should be able to right click on the map to create a route.
See thedocumentation that contains e.g.the elevation guide and thedeployment guide.
The Docker images created by the community from themaster branch can be foundhere(currently daily). See theDockerfile for more details.
To see the road routing feature of GraphHopper in action please go toGraphHopper Maps.
GraphHopper Maps is an open source user interface, which you can findhere. It can use this open source routing engine or theGraphHopper Directions API, which provides the Routing API, a Route Optimization API (based onjsprit), a fast Matrix API and an address search (based onphoton). 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 isOmniscale.
All this is available for free, via encrypted connections and from German servers for a nice and private route planning experience!
There is aweb service that can be consumed byour navigation Android client.
Offline routing isno longer officially supported but should still work. Seeversion 1.0 with still an Androiddemo andthis 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 /sptendpoint (shortest path tree).See #1577
There is the map matching subproject to snap GPX traces to the road.
GraphHopper supports several routing algorithms, such asDijkstra andA* and its bidirectional variants.Furthermore, it allows you to useContraction Hierarchies (CH)very easily. We call thisspeed mode; without this CH preparation, we call itflexible 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 thehybrid 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 anorder 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 detailshere.
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 fromOpenStreetMap, GraphHopper wouldn't be possible at all.Other map data will need a custom import procedure, see e.g.Ordnance Survey,Shapefile like ESRI orNavteq.
GraphHopper is written in Java and officially runs on Linux, Mac OS X and Windows.
Embed GraphHopper with OpenStreetMap support into your Java application via the following snippet:
<dependency> <groupId>com.graphhopper</groupId> <artifactId>graphhopper-core</artifactId> <version>[LATEST-VERSION]</version></dependency>
Seeour example application to get started fast.
You can customize GraphHopper with Java knowledge (with a high and low level API) and also without Java knowledge using thecustom models.
With the web module, we provide code to query GraphHopper over HTTP and decrease bandwidth usage as much as possible.For that we use an efficient polyline encoding, the Ramer–Douglas–Peucker algorithm, and a simpleGZIP servlet filter.
On the client side, we provide aJava andJavaScriptclient.
GraphHopper also runs on the Desktop in a Java application without internet access.For debugging purposes GraphHopper can produce vector tiles, i.e. a visualization of the road network in the browser (see #1572). Also a more low level Swing-based UI is provided via MiniGraphUI in the tools module, see somevisualizations done with ithere.A fast and production ready map visualization for the Desktop can be implemented viamapsforge ormapsforge vtm.
Here is a list of the more detailed features:
- Works out of the box with OpenStreetMap (osm/xml and pbf) and can be adapted to custom data
- OpenStreetMap integration: stores and considers road type, speed limit, the surface, barriers, access restrictions, ferries,conditional access restrictions, ...
- GraphHopper is fast. And with the so called "Contraction Hierarchies" it can be even faster (enabled by default).
- Memory efficient data structures, algorithms andthe low and high level API is tuned towards ease of use and efficiency
- Pre-built routing profiles: car, bike, racing bike, mountain bike, foot, hike, motorcycle, ...
- Customization of these profiles are possible and e.g. get truck routing or support for cargo bikes andmany other changes
- Provides a powerfulweb API that exposes the data from OpenStreetMap and allows customizing the vehicle profiles per request. With JavaScript and Java clients.
- Doesmap matching
- Supports public transit routing andGTFS.
- Offers turn instructions in more than 45 languages, contribute or improvehere
- Displays and takes into accountelevation data
- Alternative routes
- Turn costs and restrictions
- Country specific routing via country rules
- Allows customizing routing behavior using custom areas
- The core uses only a few dependencies (hppc, jts, janino and slf4j)
- Scales from small indoor-sized to world-wide-sized graphs
- Finds nearest point on street e.g. to get elevation or 'snap to road' or being used as spatial index (see#1485)
- Calculates isochrones andshortest path trees
- Shows the whole road network in the browser for debugging purposes ("vector tile support")#1572
- Shows details along a route like road_class or max_speed ("path details")#1142
- Written Java and simple start for developers via Maven.
About
An open source route planning library and server using OpenStreetMap.
Resources
License
Contributing
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Languages
- Java98.1%
- JavaScript1.6%
- Other0.3%






