# GraphHopper — Fast Open Source Route Planning Engine > GraphHopper is a Java-based routing engine using OpenStreetMap data that supports driving, cycling, walking, and custom vehicle profiles with isochrone and map matching APIs. ## Install Save as a script file and run: # GraphHopper — Fast Open Source Route Planning Engine ## Quick Use ```bash wget https://repo1.maven.org/maven2/com/graphhopper/graphhopper-web/9.1/graphhopper-web-9.1.jar wget https://download.geofabrik.de/europe/germany-latest.osm.pbf java -Ddw.graphhopper.datareader.file=germany-latest.osm.pbf -jar graphhopper-web-9.1.jar server config-example.yml ``` Query: `curl "http://localhost:8989/route?point=52.52,13.41&point=48.14,11.58&profile=car"` ## Introduction GraphHopper is a routing engine written in Java that computes fast paths on OpenStreetMap road networks. It supports multiple vehicle profiles, turn costs, elevation data, and advanced features like isochrones, map matching, and route optimization out of the box. ## What GraphHopper Does - Calculates point-to-point routes with distance, time, and geometry for any vehicle profile - Generates isochrone polygons showing reachable areas within a given time or distance - Matches GPS traces to road segments with its map matching API - Solves vehicle routing problems (VRP) via the jsprit-based optimization API - Supports elevation-aware routing using SRTM or CGIAR elevation data ## Architecture Overview GraphHopper preprocesses OSM data into a contraction hierarchy or landmark-based graph stored on disk and memory-mapped for fast access. The routing server exposes a REST API built on Dropwizard. Custom profiles are defined in YAML, specifying vehicle dimensions, speed factors, and access restrictions. The modular architecture allows swapping shortest-path algorithms and adding custom weightings. ## Self-Hosting & Configuration - Download the JAR file or build from source with Maven - Provide an OSM PBF file and a YAML configuration file - Define vehicle profiles in the config with speed, access, and turn cost settings - Enable elevation by specifying an SRTM data provider in the configuration - Deploy with Docker using the official `graphhopper/graphhopper` image ## Key Features - Multiple routing profiles (car, bike, foot, motorcycle, truck) configurable via YAML - Isochrone API for computing reachable regions within time or distance thresholds - Route optimization API for solving multi-stop vehicle routing problems - Elevation-aware routing that accounts for hills in cycling and walking profiles - Flexible custom model system for adjusting speeds and priorities per road type ## Comparison with Similar Tools - **OSRM** — C++ based, faster raw speed, but less flexible profiles and no built-in isochrones - **Valhalla** — multi-modal with transit support, dynamic costing, tiled storage model - **OpenTripPlanner** — focused on public transit with multi-modal routing - **pgRouting** — SQL-integrated, useful for spatial analysis, slower for real-time applications ## FAQ **Q: What languages does GraphHopper support?** A: The core is Java with a REST API usable from any language. JavaScript, Python, and other client libraries are available. **Q: Can it handle truck routing with vehicle dimensions?** A: Yes. Define truck profiles with height, width, weight, and length restrictions in the YAML config. **Q: How large a dataset can it handle?** A: It can route on a planet-scale dataset. A full planet import requires roughly 20-30 GB of heap memory. **Q: Does it support real-time traffic?** A: GraphHopper supports speed updates via its custom model system, enabling integration with live traffic feeds. ## Sources - https://github.com/graphhopper/graphhopper - https://www.graphhopper.com/open-source/ --- Source: https://tokrepo.com/en/workflows/asset-46817733 Author: Script Depot