GraphHopper Distance Matrix: Self-Host, API & Alternatives
GraphHopper Distance Matrix: Production Self-Hosting & API Guide How to Call the GraphHopper Matrix API (/matrix Endpoint) Running GraphHopper distance matrix in production requires configuring Docker deployment, the /matrix API endpoint, Custom Models for vehicle-specific routing (truck/motorcycle), H3-based Redis caching, and evaluating performance tradeoffs against OSRM, Valhalla, and Google Maps (for an in-depth analysis of routing engine selection, see our OSRM vs GraphHopper Architecture Comparison). The /matrix endpoint evaluates element-by-element matrix calculations between sets of origin and destination coordinates. When issuing requests, callers specify input point arrays along with requested output arrays such as times (travel duration in seconds) and distances (road distance in meters). Depending on graph preparation, GraphHopper can evaluate matrix queries using speed-optimized Contraction Hierarchies (CH) or flexible Landmark-based (LM) routing models. ...