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

OSRM

33
84
+ 1
0
Valhalla

14
58
+ 1
3
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.

Manage your open source components, licenses, and vulnerabilities
Learn More
Pros of OSRM
Pros of Valhalla
    Be the first to leave a pro
    • 3
      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?
    Manage your open source components, licenses, and vulnerabilities
    Learn 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.
    Postman
    It is the only complete API development environment, used by nearly five million developers and more than 100,000 companies worldwide.
    Postman
    It is the only complete API development environment, used by nearly five million developers and more than 100,000 companies worldwide.
    Stack Overflow
    Stack Overflow is a question and answer site for professional and enthusiast programmers. It's built and run by you as part of the Stack Exchange network of Q&A sites. With your help, we're working together to build a library of detailed answers to every question about programming.
    See all alternatives