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

pgRouting

10
23
+ 1
8
Valhalla

14
58
+ 1
2
Add tool

Valhalla vs pgRouting: What are the differences?

Introduction: Valhalla and pgRouting are two popular routing engines used in geographical information systems (GIS). While both are powerful tools for calculating routes, there are several key differences between them that make them suitable for different use cases.

  1. Data Sources: The first significant difference between Valhalla and pgRouting lies in their data sources. Valhalla utilizes OpenStreetMap (OSM) data to compute routes, enabling it to take advantage of the rich and constantly updated information available in OSM. On the other hand, pgRouting can work with various data sources, including OSM, databases like PostgreSQL, or even Shapefiles, providing more flexibility in choosing the underlying data.

  2. Network Model: Valhalla and pgRouting employ different network models for routing calculations. Valhalla uses a multi-modal graph model, which means it can handle not only road networks but also other travel modes like public transit, biking, or walking. This flexibility makes Valhalla suitable for diverse routing scenarios. In contrast, pgRouting utilizes a more traditional network model specifically designed for road networks, making it a preferred option when focusing solely on road-based routing.

  3. Algorithmic Approach: Another key difference lies in the algorithms employed by Valhalla and pgRouting. Valhalla relies on a custom algorithm called "Dijkstrance" that combines A* search and Dijkstra's algorithm, allowing it to compute routes efficiently with options like time-aware or distance-optimized routing. In contrast, pgRouting offers a range of routing algorithms, including Dijkstra's, A*, or even bidirectional algorithms, giving users more flexibility when choosing the algorithm best suited for their specific use case.

  4. Extended Features: Valhalla and pgRouting also differ in terms of the additional features they offer. Valhalla, for instance, provides advanced features like turn-by-turn directions, isochrones (areas reachable within a specific time or distance), and matrix calculations (computing travel times or distances between multiple points). On the other hand, pgRouting comes with a set of useful functions to work with road networks, including functions for calculating closest points, calculating shortest paths across multiple layers, or even performing network analysis operations.

  5. Integration and APIs: Valhalla and pgRouting also offer different integration options and APIs. Valhalla provides a complete routing solution with customizable server-side APIs and SDKs for different programming languages, facilitating its integration into various systems. Conversely, pgRouting integrates directly into the PostgreSQL database, providing seamless integration with spatial databases and enabling SQL-based queries for routing calculations.

  6. Community and Support: Lastly, Valhalla and pgRouting differ in terms of their communities and support. Valhalla has gained popularity within the open-source mapping community and benefits from active developer support. It also has an extensive documentation repository and a dedicated issue tracker for bug reporting. On the other hand, pgRouting has a well-established community built around the PostgreSQL ecosystem, providing forums, mailing lists, and official documentation specific to pgRouting.

In summary, Valhalla and pgRouting differ in their data sources, network models, algorithmic approaches, extended features, integration options, and community support. Understanding these differences is crucial in selecting the appropriate routing engine based on the specific requirements of a GIS project.

Get Advice from developers at your company using StackShare Enterprise. Sign up for StackShare Enterprise.
Learn More
Pros of pgRouting
Pros of Valhalla
  • 3
    Dynamic routing
  • 1
    Routing in the database
  • 1
    Open Source
  • 1
    Data changes are reflected instantaneously
  • 1
    Geospatial network analysis
  • 1
    QGIS plugin
  • 2
    Open source

Sign up to add or upvote prosMake informed product decisions

What is pgRouting?

It is an extension of PostGIS and PostgreSQL geospatial database and adds routing and other network analysis functionality.

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 pgRouting?
What companies use Valhalla?
See which teams inside your own company are using pgRouting 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 pgRouting?
What tools integrate with Valhalla?
What are some alternatives to pgRouting and Valhalla?
OSRM
It is a C++ implementation of a high-performance routing engine for shortest paths in road networks
Neo4j
Neo4j stores data in nodes connected by directed, typed relationships with properties on both, also known as a Property Graph. It is a high performance graph store with all the features expected of a mature and robust database, like a friendly query language and ACID transactions.
Slick
It is a modern database query and access library for Scala. It allows you to work with stored data almost as if you were using Scala collections while at the same time giving you full control over when a database access happens and which data is transferred.
Spring Data
It makes it easy to use data access technologies, relational and non-relational databases, map-reduce frameworks, and cloud-based data services. This is an umbrella project which contains many subprojects that are specific to a given database.
DataGrip
A cross-platform IDE that is aimed at DBAs and developers working with SQL databases.
See all alternatives