Need advice about which tool to choose?Ask the StackShare community!

OSRM

32
83
+ 1
0
Valhalla

14
58
+ 1
2
Add tool

OSRM vs Valhalla: What are the differences?

Introduction:

In the realm of routing options for web developers, there are two prominent choices to consider: OSRM and Valhalla. Both OSRM and Valhalla are open-source routing engines that provide efficient and accurate directions for various modes of transportation. However, they differ in several key aspects, which we will delve into in the sections below.

  1. Routing Algorithm: OSRM utilizes Contraction Hierarchies (CH) as its default routing algorithm. CH is an optimization technique that pre-processes the data to enable fast shortest path calculations. It achieves this by contracting less important nodes early, reducing the search space during routing. On the other hand, Valhalla offers multiple routing algorithms, including CH, but also provides options like Time-Distance Matrix (TDM), which optimizes many-to-many distances, and Bidirectional A-Star (Bidi-A*), which sacrifices preprocessing time for faster query times.

  2. Customizability and Modularity: OSRM focuses more on providing a routing engine that is ready to use out of the box and is relatively easier to integrate into existing systems. It offers a more streamlined experience but can lack flexibility for those seeking more customization options. In contrast, Valhalla emphasizes modularity and extensibility, allowing developers to cherry-pick the desired components, enabling customization and integration with various data sources.

  3. Data Storage and Format: OSRM typically requires pre-processing of the input data, creating a compressed graph representation that is stored and used during routing. This upfront preprocessing enables faster query times but necessitates additional storage space. In contrast, Valhalla is designed to operate on raw OpenStreetMap (OSM) data without requiring preprocessing. However, this may lead to slightly longer query times compared to OSRM, as computations are performed directly on the original data.

  4. Additional Features and APIs: OSRM provides a simplified, yet focused set of APIs centered around routing, including nearest queries, table queries, and match service for GPS traces. Valhalla, on the other hand, offers an extensive catalog of additional features, such as isochrone generation, time-aware routing, elevation data support, real-time traffic integration, and more. These additional features make Valhalla a more comprehensive solution, catering to a wider range of routing needs.

  5. Community and Documentation: OSRM has been actively developed since 2014 and boasts a large user community, making it relatively easier to find online resources and documentation. Valhalla, while gaining popularity, is a relatively newer project, and its user base and community are still growing. Consequently, finding comprehensive documentation and community support might be more challenging for Valhalla users, although efforts are being made to address this.

  6. Performance and Scalability: OSRM's focus on preprocessing allows it to offer excellent performance and scalability. Its CH algorithm shines in scenarios with static and relatively large datasets, where precomputing shortcuts helps reduce query times. However, Valhalla's flexible architecture enables its routing engine to leverage parallel processing and distributed computing, making it more suitable for scenarios with dynamic and rapidly changing data, such as real-time traffic updates.

In summary, OSRM and Valhalla differ in aspects such as routing algorithm, customizability and modularity, data storage and format, additional features and APIs, community and documentation, as well as performance and scalability. Developers can choose between them based on their specific requirements, with OSRM providing a streamlined and efficient out-of-the-box experience, while Valhalla offers greater flexibility and extensibility.

Get Advice from developers at your company using StackShare Enterprise. Sign up for StackShare Enterprise.
Learn More
Pros of OSRM
Pros of Valhalla
    Be the first to leave a pro
    • 2
      Open source

    Sign up to add or upvote prosMake informed product decisions

    - No public GitHub repository available -

    What is OSRM?

    It is a C++ implementation of a high-performance routing engine for shortest paths in road networks

    What is Valhalla?

    Valhalla is Mapzen’s open-source routing service for client-side routing applications and hosted solutions. If you are looking to avoid the challenge of data creation and database administration, you can get high-quality routes and navigational guidance with clear directions through a simple API call.

    Need advice about which tool to choose?Ask the StackShare community!

    What companies use OSRM?
    What companies use Valhalla?
    See which teams inside your own company are using OSRM or Valhalla.
    Sign up for StackShare EnterpriseLearn More

    Sign up to get full access to all the companiesMake informed product decisions

    What tools integrate with OSRM?
    What tools integrate with Valhalla?
    What are some alternatives to OSRM and Valhalla?
    Google Maps
    Create rich applications and stunning visualisations of your data, leveraging the comprehensiveness, accuracy, and usability of Google Maps and a modern web platform that scales as you grow.
    pgRouting
    It is an extension of PostGIS and PostgreSQL geospatial database and adds routing and other network analysis functionality.
    Leaflet
    Leaflet is an open source JavaScript library for mobile-friendly interactive maps. It is developed by Vladimir Agafonkin of MapBox with a team of dedicated contributors. Weighing just about 30 KB of gzipped JS code, it has all the features most developers ever need for online maps.
    Mapbox
    We make it possible to pin travel spots on Pinterest, find restaurants on Foursquare, and visualize data on GitHub.
    OpenLayers
    An opensource javascript library to load, display and render maps from multiple sources on web pages.
    See all alternatives