Back to services

GraphHopper

Fast routing library and server using OpenStreetMap.

View alternatives to GraphHopper
Suggest edit
Open source
Self-hostable
Apache-2.0
Recent reviews

Alternatives

Tech stack

No tech stack added yet. Sign in to suggest some

Note: We were unable to fetch the official website, so the following is compiled from what is known about GraphHopper. Please refer to the official website for exact pricing and API details.

Overview

GraphHopper is a fast, memory-efficient routing engine that mainly uses OpenStreetMap (OSM) data. It comes in two forms:

  • Open-source routing engine: Written in Java and licensed under the Apache License 2.0. You can deploy and modify it yourself.
  • GraphHopper Directions API: A commercial cloud service run by the GraphHopper team. It offers a range of geo and logistics APIs, is accessed with an API key, and has paid plans.

Key Features

  • Routing API: Calculates routes between two or more points and returns distance, time, route geometry, and turn-by-turn instructions. Supports multiple modes of travel, including car, bike, and walking.
  • Distance/time matrix (Matrix API): Calculates distances and travel times between many origins and destinations in bulk. Commonly used for dispatching and delivery analysis.
  • Route Optimization API: Solves the traveling salesman problem (TSP) and vehicle routing problem (VRP), with support for constraints such as time windows, load capacity, and multiple vehicles.
  • Geocoding API: Forward and reverse conversion between addresses and coordinates.
  • Map Matching: Aligns noisy GPS traces to the road network.
  • Isochrone: Calculates the area reachable within a given time or distance.
  • Custom Model: Adjusts route preferences based on conditions such as road type, slope, and speed limit, so you can customize routing behavior without changing code.

Target Users and Use Cases

  • Logistics and delivery companies: planning delivery routes and optimizing fleet dispatch
  • Developers of travel and mapping apps: integrating navigation and route calculation into their apps
  • Cycling, hiking, and other outdoor apps: providing dedicated routes for different modes of travel
  • Researchers and GIS professionals: analyzing accessibility and transportation networks
  • Teams that care about data privacy and want offline use: deploying the routing service on their own servers

Core Strengths

  • Open source and self-hostable: Apache 2.0 license, free for commercial use, with no dependence on third-party cloud services.
  • High performance: Supports acceleration algorithms such as Contraction Hierarchies and Landmarks (ALT), returning results in milliseconds even on large road networks.
  • Flexible: You can choose the faster preprocessed mode or the more flexible custom routing mode, depending on your needs.
  • Open data: Based on OSM with global coverage, and you are free to update the map data.
  • Easy migration: You can go live quickly with the hosted API and switch to a self-hosted deployment later.

Self-Hosted Deployment

  1. Install a Java runtime (newer versions require a recent JDK; see the project documentation for the exact version).
  2. Download the graphhopper-web JAR and the sample configuration file config-example.yml from GitHub Releases.
  3. Download OSM data for the region you need (in .osm.pbf format, for example from Geofabrik).
  4. Start the service:
java -D"dw.graphhopper.datareader.file=your-region.osm.pbf" -jar graphhopper-web-*.jar server config-example.yml
  1. On the first launch, it imports the data and builds the road network graph. Once that finishes, open http://localhost:8989 in your browser to use the built-in map interface and the HTTP API.

The community also offers other deployment options, such as Docker images.

Technical Requirements

  • Java runtime
  • Memory requirements vary with the size of the imported region: a single country typically needs a few GB, while importing global data requires significantly more
  • Map data comes from OpenStreetMap

Notable Points

  • It is one of the mainstream choices among open-source routing engines and is often compared with OSRM and Valhalla.
  • The hosted Directions API includes features the open-source version lacks, such as full route optimization and geocoding services.
  • The community is active, with a forum and thorough documentation.