Intro to Valhalla



Valhalla is a multi-purpose routing engine originally created by Mapzen's mobility team, which was led by and included the founders of Interline. Now, Valhalla is also used by organizations like Mapillary (street imagery), Mapbox (mapping APIs), Tesla (electric cars), and Sidewalk Labs (urban real-estate development and operations). Valhalla is open-source (MIT license) and is maintained by many contributors.

Interline continues its involvement in open-source Valhalla, providing a variety of products and services to help organizations and individuals use Valhalla.

What functions can Valhalla perform?

schematic example of a turn-by-turn route
turn-by-turn directions

Plan trips from Point A to Point B — and any number of other destinations.

schematic example of a time/distance matrix
time/distance matrixes

Rapidly calculate travel distances and times between many locations.

schematic example of an optimized route
optimized routes

Plan the shortest route to visit many locations (a.k.a. traveling salesman).

schematic example of an access isochrone
access isochrones

Compute the boundaries of how far one can travel in 15 minutes, 30 minutes, and so on from an origin location.

schematic example of a location-to-map match
location-to-map matches

Snap GPS probe data (or location data from another "noisy" source) with roadways and other elements of a transportation network.

What makes Valhalla unique?

🌎 OpenStreetMap
Valhalla is designed to work with the rich data model of OpenStreetMap. It normalizes a wide range of tags into a consistent roadway hierarchy. It applies country-specific parameters to handle different laws (e.g., drive on right vs. on left) and default speed limits.
📜 Narrative guidance
When generating turn-by-turn routes, Valhalla generates rich narrative guidance that's available in multiple languages. Without duplicative manuevers (no unnecessary instructions to "continue"). Ready for output as text-to-speech (TTS) on a smartphone.
🚌 Multimodal
Valhalla supports many travel modes: auto, high-occupany auto, bicycle, motor scooter, pedestrian, and public transit.
⚙️ Dynamic costing
All of Valhalla's travel modes can be customized on the fly by changing costing parameters in each query.
Tiled data structure
Valhalla generates and consumes its routing graph as tiles. This format allows an instance of Valhalla to scale to cover the entire planet, or to be specific to one metropolitan region.
📱 Embeddable
Valhalla is primarily written in C++. It can be used for embedded applications in auto infotainment systems, on iOS, and on Android.

When is an alternative more appropriate?

🚌 Public Transit Agencies
Valhalla can provide worldwide transit routing, using data ingested from Transitland. However, Valhalla does not currently provide all the options that a public transit agency may want to offer to their riders. Thus, we suggest that public transit agencies wanting to offer a trip planning portal instead use OpenTripPlanner (OTP). We've partnered with Trillium Solutions to offer this service to transit agencies. Please contact Trillium for more information.
🚦 Traffic-influenced Routing
Valhalla cannot accept real-time or historical traffic data in a drop-in fashion. While at Mapzen, we created a fully working prototype of traffic-influenced routing in Valhalla. However, for production applications that require routing and ETAs that fully factor in traffic conditions, we recommend Google Maps APIs or Inrix for the time being.

How can I run Valhalla?

Docker

Valhalla is distributed as a Docker container. Easy to run on your Windows or Mac computer for testing. Deploy to GCP Kubernetes Engine, AWS Elastic Container Service, or another container scheduler. more info

Mac OS

Valhalla can be compiled from source and installed on Mac OS using the Homebrew package manager. more info

Linux

Valhalla is distributed as PPA packages for Ubuntu and similar distributions of Linux. more info

How can I best use Valhalla?

Step through these questions and, by the end, you'll have a fully working deployment of Valhalla:

  1. On what type of infrastructure will you be running Valhalla: Docker containers, Linux packages, or Mac OS packages?
  2. Do you need Valhalla routing graph coverage for the entire planet or only certain regions?
  3. How frequently do you need your Valhalla routing graph to be updated? This will determine how long it takes for a fix to OpenStreetMap to be available in your routing engine
  4. Do you need elevation data included in your Valhalla routing graph? (It's included by default in Interline Valhalla Tilepacks.)
  5. How many instance of the Valhalla service do you want to run for high-availability and fail-over redundancy?
  6. Do you need to customize your Valhalla configuration (the valhalla.json file)?
  7. Do you want to run your own Valhalla tile-build pipeline or download Valhalla Tilepacks from Interline?

Need help answering these questions for your organization? We've helped a variety of organizations do so through our Valhalla consulting.

How can Interline help me to use Valhalla?

We recommend Valhalla Tilepacks if you:

  • want to control your own Valhalla server(s)
  • know how to deploy Docker containers or PPA packages
  • don't want to run an entire Valhalla tile build pipeline
  • want to get started quickly
Download Valhalla Tilepacks

We recommend custom Valhalla consulting if you:

  • are unfamiliar with Docker containers or PPA packages
  • need to have custom control over a Valhalla tile build pipeline
  • want custom integrations between Valhalla and your own systems or data
Custom Valhalla Consulting